We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70dfc67 commit 81c05a1Copy full SHA for 81c05a1
packages/hypergraph-react/src/HypergraphAppContext.tsx
@@ -299,7 +299,11 @@ export function HypergraphAppProvider({
299
300
const syncServerUrl = new URL(syncServerUri);
301
const syncServerWsUrl = new URL(`/?token=${identity.sessionToken}`, syncServerUrl.toString());
302
- syncServerWsUrl.protocol = 'ws:';
+
303
+ // Use 'wss:' by default, only use 'ws:' for local development
304
+ const isLocalDev = syncServerUrl.hostname === 'localhost' || syncServerUrl.hostname === '127.0.0.1';
305
+ syncServerWsUrl.protocol = isLocalDev ? 'ws:' : 'wss:';
306
307
const syncServerWsUrlString = syncServerWsUrl.toString();
308
309
const websocketConnection = new WebSocket(syncServerWsUrlString);
0 commit comments