querysub 0.81.0 → 0.82.0
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
CHANGED
|
@@ -13,7 +13,6 @@ export async function hackDevtoolsWebsocketForward(config: {
|
|
|
13
13
|
externalPort: number;
|
|
14
14
|
cancel: () => void;
|
|
15
15
|
}> {
|
|
16
|
-
let hasConnected = false;
|
|
17
16
|
const server = net.createServer();
|
|
18
17
|
|
|
19
18
|
// Start listening on a random available port, binding to all interfaces (0.0.0.0)
|
|
@@ -30,8 +29,6 @@ export async function hackDevtoolsWebsocketForward(config: {
|
|
|
30
29
|
|
|
31
30
|
console.log(`Forwarding connection from ${config.externalIP}:${(address as any).port} to 127.0.0.1:${config.internalPort}`);
|
|
32
31
|
|
|
33
|
-
hasConnected = true;
|
|
34
|
-
|
|
35
32
|
// Forward the connection to the internal port
|
|
36
33
|
const internalConnection = net.createConnection({
|
|
37
34
|
host: "127.0.0.1",
|
|
@@ -55,7 +52,9 @@ export async function hackDevtoolsWebsocketForward(config: {
|
|
|
55
52
|
// // Handle socket closure
|
|
56
53
|
socket.on("close", () => {
|
|
57
54
|
internalConnection.destroy();
|
|
58
|
-
|
|
55
|
+
// TESTING:
|
|
56
|
+
// - For now, we don't close the server, so... we can reconnect. I think this might be required...
|
|
57
|
+
//server.close();
|
|
59
58
|
});
|
|
60
59
|
socket.on("error", (err) => {
|
|
61
60
|
internalConnection.destroy();
|