itwillsync 1.3.3 → 1.3.5
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/dist/index.js
CHANGED
|
@@ -3457,7 +3457,7 @@ var require_websocket_server = __commonJS({
|
|
|
3457
3457
|
socket.on("error", socketOnError);
|
|
3458
3458
|
const key = req.headers["sec-websocket-key"];
|
|
3459
3459
|
const upgrade = req.headers.upgrade;
|
|
3460
|
-
const
|
|
3460
|
+
const version2 = +req.headers["sec-websocket-version"];
|
|
3461
3461
|
if (req.method !== "GET") {
|
|
3462
3462
|
const message = "Invalid HTTP method";
|
|
3463
3463
|
abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);
|
|
@@ -3473,7 +3473,7 @@ var require_websocket_server = __commonJS({
|
|
|
3473
3473
|
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
|
|
3474
3474
|
return;
|
|
3475
3475
|
}
|
|
3476
|
-
if (
|
|
3476
|
+
if (version2 !== 13 && version2 !== 8) {
|
|
3477
3477
|
const message = "Missing or invalid Sec-WebSocket-Version header";
|
|
3478
3478
|
abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
|
|
3479
3479
|
"Sec-WebSocket-Version": "13, 8"
|
|
@@ -3517,7 +3517,7 @@ var require_websocket_server = __commonJS({
|
|
|
3517
3517
|
}
|
|
3518
3518
|
if (this.options.verifyClient) {
|
|
3519
3519
|
const info = {
|
|
3520
|
-
origin: req.headers[`${
|
|
3520
|
+
origin: req.headers[`${version2 === 8 ? "sec-websocket-origin" : "origin"}`],
|
|
3521
3521
|
secure: !!(req.socket.authorized || req.socket.encrypted),
|
|
3522
3522
|
req
|
|
3523
3523
|
};
|
|
@@ -4170,6 +4170,11 @@ async function runSetupWizard() {
|
|
|
4170
4170
|
return config;
|
|
4171
4171
|
}
|
|
4172
4172
|
|
|
4173
|
+
// src/cli-options.ts
|
|
4174
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
4175
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
4176
|
+
import { dirname as dirname3, join as join5 } from "path";
|
|
4177
|
+
|
|
4173
4178
|
// src/hub-client.ts
|
|
4174
4179
|
import { spawn as spawn2 } from "child_process";
|
|
4175
4180
|
import { readFileSync as readFileSync2, existsSync as existsSync2, unlinkSync } from "fs";
|
|
@@ -4277,8 +4282,8 @@ async function killStaleHub() {
|
|
|
4277
4282
|
return true;
|
|
4278
4283
|
}
|
|
4279
4284
|
async function spawnHub() {
|
|
4280
|
-
const
|
|
4281
|
-
const hubPath = join4(
|
|
4285
|
+
const __dirname2 = dirname2(fileURLToPath2(import.meta.url));
|
|
4286
|
+
const hubPath = join4(__dirname2, "hub", "daemon.js");
|
|
4282
4287
|
return new Promise((resolve, reject) => {
|
|
4283
4288
|
const child = spawn2("node", [hubPath], {
|
|
4284
4289
|
detached: true,
|
|
@@ -4470,6 +4475,11 @@ async function sendHeartbeat(sessionId) {
|
|
|
4470
4475
|
}
|
|
4471
4476
|
|
|
4472
4477
|
// src/cli-options.ts
|
|
4478
|
+
var __filename = fileURLToPath3(import.meta.url);
|
|
4479
|
+
var __dirname = dirname3(__filename);
|
|
4480
|
+
var { version } = JSON.parse(
|
|
4481
|
+
readFileSync3(join5(__dirname, "..", "package.json"), "utf-8")
|
|
4482
|
+
);
|
|
4473
4483
|
var DEFAULT_PORT = SESSION_PORT_START;
|
|
4474
4484
|
function parseArgs(argv) {
|
|
4475
4485
|
const options = {
|
|
@@ -4531,7 +4541,7 @@ function parseArgs(argv) {
|
|
|
4531
4541
|
printHelp();
|
|
4532
4542
|
process.exit(0);
|
|
4533
4543
|
} else if (arg === "--version" || arg === "-v") {
|
|
4534
|
-
console.log(
|
|
4544
|
+
console.log(`itwillsync v${version}`);
|
|
4535
4545
|
process.exit(0);
|
|
4536
4546
|
} else {
|
|
4537
4547
|
options.command = args.slice(i);
|
|
@@ -4583,8 +4593,8 @@ Hub Management:
|
|
|
4583
4593
|
}
|
|
4584
4594
|
|
|
4585
4595
|
// src/index.ts
|
|
4586
|
-
import { fileURLToPath as
|
|
4587
|
-
import { join as
|
|
4596
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
4597
|
+
import { join as join6, dirname as dirname4 } from "path";
|
|
4588
4598
|
import { spawn as spawn3 } from "child_process";
|
|
4589
4599
|
function preventSleep() {
|
|
4590
4600
|
try {
|
|
@@ -4735,8 +4745,8 @@ async function main() {
|
|
|
4735
4745
|
const port = await findAvailablePort(options.port);
|
|
4736
4746
|
const host = options.localhost ? "127.0.0.1" : "0.0.0.0";
|
|
4737
4747
|
const ip = await resolveSessionIP(networkingMode, options.localhost);
|
|
4738
|
-
const
|
|
4739
|
-
const webClientPath =
|
|
4748
|
+
const __dirname2 = dirname4(fileURLToPath4(import.meta.url));
|
|
4749
|
+
const webClientPath = join6(__dirname2, "web-client");
|
|
4740
4750
|
const ptyManager = new PtyManager(cmd, cmdArgs);
|
|
4741
4751
|
const server = createSyncServer({
|
|
4742
4752
|
ptyManager,
|