amitu-websocket-client icon indicating copy to clipboard operation
amitu-websocket-client copied to clipboard

SocketIOClient.run() causes "Invalid frame"

Open alp82 opened this issue 12 years ago • 0 comments

I try to run the following code:

s = SocketIOClient('localhost', 9000)
s.run()

I get the error "Invalid frame".

The socket.io server is running (gevent-socketio).

Stacktrace:

Environment:
Request Method: GET
Request URL: http://test.local:8000/test

Django Version: 1.4
Python Version: 2.6.6
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'test')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 )

Traceback:
File "/home/test/env/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/test/project/forms.py" in validateForm
  32.     s.run()
File "/home/test/project/socketio_client.py" in run
  143.         super(SocketIOClient, self).run()
    File "/home/test/project/websocket_client.py" in run
  108.             buf = self._consume_frames(buf)
File "/home/test/project/websocket_client.py" in _consume_frames
  97.             if frame[0] != FRAME_START: raise WebSocketError("Invalid frame")

Exception Type: WebSocketError at /test
Exception Value: Invalid frame

alp82 avatar Jun 06 '12 15:06 alp82