@pylonsync/sync 0.3.42 → 0.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +10 -12
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1015,23 +1015,21 @@ export class SyncEngine {
|
|
|
1015
1015
|
const isHttps = url.protocol === "https:";
|
|
1016
1016
|
const scheme = isHttps ? "wss" : "ws";
|
|
1017
1017
|
|
|
1018
|
-
// HTTPS deploys
|
|
1019
|
-
//
|
|
1020
|
-
//
|
|
1021
|
-
//
|
|
1022
|
-
//
|
|
1018
|
+
// Production HTTPS deploys: multiplex WS on the same origin via
|
|
1019
|
+
// `/api/sync/ws`. The Pylon runtime accepts the Upgrade on its
|
|
1020
|
+
// main HTTP port (4321), so any reverse proxy that already
|
|
1021
|
+
// forwards `/api/*` carries the WebSocket through too. No
|
|
1022
|
+
// separate WS port to expose, no per-deployment wsUrl env var.
|
|
1023
1023
|
//
|
|
1024
|
-
//
|
|
1025
|
-
//
|
|
1026
|
-
//
|
|
1027
|
-
//
|
|
1028
|
-
// (most production proxies multiplex WS on 443 via the Upgrade
|
|
1029
|
-
// header, and a future pylon build will do the same).
|
|
1024
|
+
// Local dev (`pylon dev` on `http://localhost:4321`) keeps the
|
|
1025
|
+
// legacy port+1 fallback so existing tutorials still work without
|
|
1026
|
+
// touching their app config — the dedicated `:4322` listener is
|
|
1027
|
+
// still running there too.
|
|
1030
1028
|
if (url.port) {
|
|
1031
1029
|
const port = parseInt(url.port, 10);
|
|
1032
1030
|
return `${scheme}://${url.hostname}:${port + 1}`;
|
|
1033
1031
|
}
|
|
1034
|
-
return `${scheme}://${url.
|
|
1032
|
+
return `${scheme}://${url.host}/api/sync/ws`;
|
|
1035
1033
|
}
|
|
1036
1034
|
|
|
1037
1035
|
/**
|