Trying to fix reverse proxy for websockets

This commit is contained in:
Julien Valverdé
2024-07-17 02:32:46 +02:00
parent 2daf60faf3
commit af9baa3e9a
3 changed files with 14 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ export interface TRPCClientProviderProps {
export function TRPCClientProvider({ children }: TRPCClientProviderProps) {
const [queryClient] = useState(new QueryClient())
const [wsClient] = useState(createWSClient({ url: "ws://localhost:8080" }))
const [wsClient] = useState(createWSClient({ url: "/" }))
const [trpcClient] = useState(trpc.createClient({
links: [
@@ -22,7 +22,7 @@ export function TRPCClientProvider({ children }: TRPCClientProviderProps) {
true: wsLink({ client: wsClient }),
false: httpBatchLink({
url: "http://localhost:8080/rpc",
url: "/rpc",
headers: {},
}),
})