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

No support for sub-protocols #36

Open
wbramw opened this issue May 17, 2016 · 3 comments
Open

No support for sub-protocols #36

wbramw opened this issue May 17, 2016 · 3 comments

Comments

@wbramw
Copy link

wbramw commented May 17, 2016

Thanks to this great script, I got a websocket server up and running very quickly, so thank a lot for this!
Unfortunately one of the web clients that needs to connect to this, has a sub-protocol defined when setting up the websocket connection.
Is there any support for this in this websocket server?

@dpallot
Copy link
Owner

dpallot commented Jan 13, 2017

Can you elaborate on what sub-protocol you are referring to?

@YonathanB
Copy link

YonathanB commented Jun 17, 2018

I think I have the same issue here.
Please take a look at that issue: https://stackoverflow.com/questions/34198566/websocket-error-during-websocket-handshake-sent-non-empty-sec-websocket-proto

@alfem
Copy link

alfem commented Oct 24, 2018

Yes, I have got the same issue. Using a python websocket library to connect with this server the connection drops with an error like this:

Traceback (most recent call last):
File "/home/alfem/acala/prog/help-channel/tests/pycos/init.py", line 3676, in _schedule
retval = task._generator.send(task._value)
File "./hctunnel.py", line 70, in hcwst
ws.connect(repeater_ws, subprotocols=["binary"],sockopt=(socket.IPPROTO_TCP, socket.TCP_NODELAY))
File "/home/alfem/acala/prog/help-channel/tests/websocket/_core.py", line 220, in connect
self.handshake_response = handshake(self.sock, *addrs, **options)
File "/home/alfem/acala/prog/help-channel/tests/websocket/_handshake.py", line 70, in handshake
success, subproto = _validate(resp, key, options.get("subprotocols"))
File "/home/alfem/acala/prog/help-channel/tests/websocket/_handshake.py", line 157, in _validate
subproto = headers.get("sec-websocket-protocol", None).lower()
AttributeError: 'NoneType' object has no attribute 'lower'

If I check the headers array, my client is not receiving that 'sec-websocket-protocol'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants