I'm facing a problem while using Pyramid Framework 1.5 and Gevent-socketio in the server-side and Socket.IO V1.3 in the client side. The problem I have is that when I am opening a socket in the client side the server throws Internal Server Error (500). Also, the terminal outputs the following lines:
socket = environ['socketio']
KeyError: 'socketio'
I've search about this problem and I read that it has something to do with the WSGI server I'm using (Which is currently Gunicorn. Maybe the way I am using it or set it up is wrong) but I couldn't find any good resource regard that issue.
I have few questions:
Thanks!
UPDATE:
Maybe I wasn't clear enough but when I am using older releases (For example, Socket.IO V0.9.6) the problem doesn't occur. but when I am changing the JavaScript file from Socket.io version 0.9.6 to Socket.IO version 1 (and above) the problem shows up.
1) The integration of Pyramid and Socket.IO has already been done for you: https://github.com/abourget/gevent-socketio
2) You can see the Gunicorn documtention for information on setting it up, including what to put in Pyramid's development.ini/production.ini files (Paster): http://docs.gunicorn.org/en/develop/configure.html#paster-applications Additional reading: https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-apps-using-gunicorn-http-server-behind-nginx#serving-python-web-applications-with-gunicorn
3) Here is information about deploying your web app for production (Nginx is a very popular alternative to Apache): http://pyramid-cookbook.readthedocs.org/en/latest/deployment/nginx.html