Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse HTTP port for WebSocket #52

Closed
fregante opened this issue Mar 19, 2023 · 1 comment
Closed

Reuse HTTP port for WebSocket #52

fregante opened this issue Mar 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@fregante
Copy link

See:

Relevant code:

nvim-ghost.nvim/binary.py

Lines 476 to 480 in bcebc1f

def _websocket_server(self):
while True:
random_port = random.randint(9000, 65535)
if not _port_occupied(random_port):
return GhostWebSocketServer(LOCALHOST, random_port, GhostWebSocket)

@subnut
Copy link
Owner

subnut commented Mar 21, 2023

In the current state of the code, it's not possible to run both the servers on the same port.

Both the servers that are being used in this binary (http.server and simple-websocket-server) try to occupy the port. So, running two servers on the same port isn't possible.

To do this, I basically need to write a whole HTTP server and a WebSocket server from scratch, which is a pretty big task that I don't have the time to do right now.

@subnut subnut closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2023
@subnut subnut added enhancement New feature or request help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants