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

Misultin doesn't close websocket connection on unmasked frame #99

Open
majek opened this issue Feb 9, 2012 · 1 comment
Open

Misultin doesn't close websocket connection on unmasked frame #99

majek opened this issue Feb 9, 2012 · 1 comment

Comments

@majek
Copy link

majek commented Feb 9, 2012

I'm using a python websocket client: WebSocket-for-Python. Actually, I'm using quite an old version:

    ./venv/bin/pip install git+git://github.com/majek/WebSocket-for-Python.git

With this client, the program hangs instead of quitting (utils.py)

from utils import WebSocket8Client
ws = WebSocket8Client("http://localhost:8000/")
ws.close() # program hangs here

Upon further investigation I was able to isolate the issue. The problem is that misultin is not closing a connection when receiving an unmasked frame (see: http://tools.ietf.org/html/rfc6455):

"The server MUST close the connection upon receiving a frame that is not masked"

Apparently misultin is not closing a connection when receiving frame \x88\x00 (unmasked fin frame). On the other hand, a proper close frame with masking, like \x88\x80\xaa\xaa\xaa\xaa seems to be understood by misultin (and the connection is clsoed).

Steps to reproduce: https://gist.github.com/1781022

  1. ./misultin_ws_close_bug.erl
  2. run node client-raw.js with sending [\x88, \x00] and see it hanging forever.
  3. run node client-raw.js with sending [\x88, \x80, \xaa, \xaa, \xaa, \xaa] and see it closing the connection quickly
@ostinelli
Copy link
Owner

thank you for this.

misultin has been discontinued, my reasons here.

r.

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

2 participants