Comments (7)
Can you please provide an example? Note that the request.environ dict is updated only here: https://github.com/abourget/gevent-socketio/blob/master/socketio/handler.py#L118. So, after the handshake, for example.
from gevent-socketio.
Thanks for the answer. After debugging a bit, I see that when I get a websocket request from the client (this is the client code: https://github.com/codysoyland/django-socketio-example/blob/master/templates/chat.html) then the PATH_INFO value is "/socket.io/websocket/". So when the following conditions are checked:
# Parse request URL and QUERY_STRING and do handshake
if request_tokens:
request_tokens = request_tokens.groupdict()
else:
handshake_tokens = self.RE_HANDSHAKE_URL.match(path)
if handshake_tokens:
return self._do_handshake(handshake_tokens.groupdict())
else:
# This is no socket.io request. Let the WSGI app handle it.
return super(SocketIOHandler, self).handle_one_response()
then handshake_tokens are false and therefore it considers it as a non socket.io request... What am I doing wrong?
from gevent-socketio.
Without having the server code to reproduce, it will be hard for me to help. When I use websocket transport, here is the path: http://localhost:8000/socket.io/1/websocket/213871869224
Which version of socket.io client are you using? I am quite new to socket.io, maybe the protocol changed. All the tests I did were with socketio 0.9.6. If you want a django app example, there is one in gevent-socketio/examples/django_chat.
from gevent-socketio.
@jewishop Closing this since you haven't responded but feel free to re-issue f you are still having problems and we can help you get it fixed.
from gevent-socketio.
Hi,
I'm getting the same problem with both my custom Flask app and the Flask chat example included (cloned from master today). Socket.io.js is 0.9.6.
Any clues ?
Traceback (most recent call last):
File "chat.py", line 154, in socketio
socketio_manage(request.environ, {'/chat': ChatNamespace}, request)
File "/home/alexandre/pyenv_socketio/local/lib/python2.7/site-packages/socketio/init.py", line 60, in socketio_manage
socket = environ['socketio']
KeyError: 'socketio'
from gevent-socketio.
Usually this means you ran it with a server that wasn't using a SocketIO worker. How are you running the app?
Also, are you sure it was using the latest gevente-socketio package? The requirements.txt had a pegged gevent-socketio version
from gevent-socketio.
You're right, I was not running it the right way :-/ I was using python chat.py
instead of python run.py
. Working good now, thanks !
from gevent-socketio.
Related Issues (20)
- How to broadcast data to a room (of socket io) when the server receives data from somewhere else (not using socket io)
- headers use integer for Access-Control-Max-Age HOT 1
- GeventSocketIOWorker fails to boot when used with gunicorn and ssl flags
- WebSocket is closed before the connection is established. HOT 1
- gevent UnicodeError HOT 3
- django.utils.importlib is removed in Django 1.9 HOT 1
- Merge working tests MR and ask people to rebase
- About renaming the "socketio" library name
- BaseNamespace.session
- SSL Error
- Django 1.10 Support
- django example won't install
- WebSocketError: Received "Socket is dead".
- My chat room sometimes the user sends the text all become?????
- how to run socket.io chat app from two different ports
- Tag 668d11edbd62052cde1583be1e1d0512c930f16d as 0.3.6?
- Release 0.3.7 with post-0.3.6 fixes? HOT 1
- Is it possible to use gevent-socketio as a socket.io client? HOT 1
- KeyError: 'socketio' in socketio_manager
- Version compatability issue on Executing Tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gevent-socketio.