-
Notifications
You must be signed in to change notification settings - Fork 284
Open
Description
I have a WebSocket service that uses the gevent-websocket library. And ws4py connects to it via a Unix socket without issue.
Recently, I switched to flask-sock (uses simple-websocket under the hood) for the server.
And now handshake fails.
With trial and error (andd LLMs help), I discovered that a workaround is to set ws.port explicitly.
So, how I do it:
from ws4py.client.geventclient import WebSocketClient
_URL = "ws+unix:///tmp/sock.sock"
ws = WebSocketClient(_URL)
if ws.port is None:
if ws.scheme == "wss":
ws.port = 443
else:
ws.port = 80
ws.connect()When the port is set, the handshake is now successful. Also, the port value is not important; even when set to "0", it works.
I see that the library always set the host (localhost in this case). Shouldn't the library also set the port?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels