-
-
Notifications
You must be signed in to change notification settings - Fork 889
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
Runtime Error #33
Comments
How did you start the app? The error seems to indicate you are not running with the gevent-socketio server, |
I did start it with
|
What really confuses me is also that in the environment there is this:
So it actually seems to use the gevent server. And also I did not change anything from the checkout repository. So I was assuming that just starting app.py should be sufficient. |
Hmm. I cannot reproduce this. I just did an install from scratch on my Mac and the example runs perfectly fine. I'm using the MacPorts Python 2.7 for this (I could not install |
I just looked through the things I had installed with brew. I found libevent and libev. I removed these and also removed the virtualenv that I created for the sample app. Then I reinstall the requirements.txt and now it seems to work. I am not sure how this can be related. Maybe when some gevent related stuff is compiled it got the wrong libs... When I want to run the app with gunicorn - how would I configure and start it? |
Miguel, sorry that I took so much of your time when it seems it was the fault of the libs I had installed on my computer not Flask-SocketIO. I really appreciate the time and effort you put into something like Flask-SocketIO! |
This is in the documentation. Here is an example cmd line:
|
It's happening the same with me: (monitor)root@vagrant-debian-wheezy:/var/sites/ipsafe/monitor/src# python server.py 10.0.2.2 - - [2014-06-05 22:23:20] "GET /socket.io/?EIO=2&transport=polling&t=1402006999937-32 HTTP/1.1" 500 161 0.017343 |
I got the same too.
The example i'm testing: from flask import Flask, render_template
from flask.ext.socketio import SocketIO, emit
HTML = '''
<html>
<head>
<script src="https://cdn.socket.io/socket.io-1.0.4.js"></script>
<script>
var socket = io();
</script>
</head>
<body>
Hello
</body>
</html>
'''
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
@app.route('/')
def index():
return HTML
@socketio.on('my event', namespace='/test')
def test_message(message):
emit('my response', {'data': message['data']})
@socketio.on('my broadcast event', namespace='/test')
def test_message(message):
emit('my response', {'data': message['data']}, broadcast=True)
@socketio.on('connect', namespace='/test')
def test_connect():
emit('my response', {'data': 'Connected'})
@socketio.on('disconnect', namespace='/test')
def test_disconnect():
print('Client disconnected')
if __name__ == '__main__':
socketio.run(app) Run with
And tried with gunicorn:
|
Please do not use the new socket.io 1.0 client libraries, that is a very recent release that is likely not supported by project gevent-socketio. Please use 0.9.16 for now. |
That was the issue. Using 0.9.16 client library works perfectly. Thanks! |
Met the same issue. |
Had the same issue with socket.io.1.1, 0.9.16 works for me |
After several hours of trying to debug this by wrapping the regular Flask app in different gevent supported wsgi servers, simply changing the client library to an older version solved the issue. 0.9.16 is available here: http://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js |
0.9.17 also appears to cause failure |
I just tried to get started with Flask-SocketIO. I cloned the repository and created a virtualenv and installed the packages from requirements.txt.
All went fine and I could start the application. It looks as if the application works from the browser, but I get the following error in the logs.
How can I make this work?
I am using Python 2.7.5 and this is the output of "pip freeze":
The text was updated successfully, but these errors were encountered: