Commit Graph

5 Commits

Author SHA1 Message Date
ff27041513 Worker Server Update - Adding Websocket Support
Add WebSocket support for long-running connections

- Implement WebSocket upgrade handling to support persistent connections
- Establish unique tunnels for each WebSocket connection
- Clean up tunnels upon WebSocket disconnect
- Maintain existing HTTP request functionality
2024-11-08 02:06:12 -05:00
f31c52a4f2 Update Worker Server
Isolated Tunnels per Request:

Each HTTP request now generates a unique tunnel server instance. This avoids potential cross-request data confusion by ensuring that no tunnel is reused across multiple requests.
Port Availability Check with getAvailablePort:

Enhanced the getAvailablePort function to check if a randomly generated port is available before using it. The function now creates a temporary server on each port to ensure it’s free, retrying until an available port is found. This prevents EADDRINUSE errors caused by attempting to bind to a port already in use.
Automatic Tunnel Closure:

Each tunnel server (tunnelServer) is configured to close automatically after the corresponding request’s response is completed. The res.on('finish') event handler triggers tunnelServer.close() to release the resources immediately, preventing any chance of accidental reuse.
Removed tunnels Object:

Since each tunnel is now temporary and used for only one request, we removed the need to track tunnels in a tunnels object. This simplifies the code and helps ensure tunnels are created and destroyed within the scope of a single request.
2024-11-07 18:49:56 -05:00
MCHost
479e0d8863 fix worker count 2024-03-29 03:09:48 -04:00
MCHost
e479133a4a fix 404.txt 2024-03-29 03:00:56 -04:00
MCHost
c51c98aacd first commit 2024-03-29 02:43:46 -04:00