diff --git a/src/core/client/framework/lib/bootstrap/createManaged.tsx b/src/core/client/framework/lib/bootstrap/createManaged.tsx index 6ab6ba7d6..9c96aadb9 100644 --- a/src/core/client/framework/lib/bootstrap/createManaged.tsx +++ b/src/core/client/framework/lib/bootstrap/createManaged.tsx @@ -56,8 +56,8 @@ interface CreateContextArguments { /** websocketURL points to our live graphql server */ const websocketURL = `${location.protocol === "https:" ? "wss" : "ws"}://${ - location.hostname -}:${location.port}/api/graphql/live`; + location.host +}/api/graphql/live`; /** * timeagoFormatter integrates timeago into our translation diff --git a/src/core/client/framework/lib/network/createNetwork.ts b/src/core/client/framework/lib/network/createNetwork.ts index 2113e7f5c..4659415dd 100644 --- a/src/core/client/framework/lib/network/createNetwork.ts +++ b/src/core/client/framework/lib/network/createNetwork.ts @@ -8,6 +8,7 @@ import { } from "react-relay-network-modern/es"; import TIME from "coral-common/time"; +import getLocationOrigin from "coral-framework/utils/getLocationOrigin"; import clientIDMiddleware from "./clientIDMiddleware"; import { ManagedSubscriptionClient } from "./createManagedSubscriptionClient"; @@ -16,7 +17,7 @@ import persistedQueriesGetMethodMiddleware from "./persistedQueriesGetMethodMidd export type TokenGetter = () => string; -const graphqlURL = "/api/graphql"; +const graphqlURL = `${getLocationOrigin()}/api/graphql`; function createSubscriptionFunction( subscriptionClient: ManagedSubscriptionClient