Hi,
I've spent quite a while trying to get a similar setup to work today - uwsgi + gevent running pyramid with wsgi and socketio. The pyramid bits work quite happily but I can't seem to get the socketio part to work. I've tried:
from socketio.server import SocketIOServer
from pyramid.paster import get_app
from gevent import monkey; monkey.patch_all()
import uwsgi
def application(environ, start_response):
app = get_app(uwsgi.opt['inifile'])
print 'Listening on port
http://0.0.0.0:8080 and on port 10843 (flash policy server)'
return SocketIOServer(('127.0.0.1',9090 ), app,
resource="
socket.io", policy_server=True,
policy_listener=('0.0.0.0', 10843))
However that doesn't return a wsgi app and doesn't work and:
#load paster app
from pyramid.paster import setup_logging
from paste.deploy import loadapp
setup_logging(uwsgi.opt['inifile'])
application = loadapp('config:%s' % (uwsgi.opt['inifile']) )
doesn't use the correct server I have the following in my production.ini which gets ignored I think:
[server:main]
use = egg:gevent-socketio#paster
and the uwsgi config is as follows:
[uwsgi]uwsgi
socket =
127.0.0.1:9090http-websockets = truen, start_response):
route = ^/
socket.io uwsgi:
127.0.0.1:9090/socket.iochdir = /data/faploid-webpt['inifile'])
file = %(chdir)/faploid.wsgi
master = truestening on port
http://0.0.0.0:8080 and on port 10843 (flash policy server)'
processes = 8
threads = 2
stats = 127.0.0.1:9191ver(('127.0.0.1',9090 ), app,
pythonpath = %(chdir)/lib/python2.7/site-packages:%(chdir)
virtualenv = %(chdir)er=('0.0.0.0', 10843))
plugins = python, gevent
inifile = %(chdir)/%s
gevent = true
async = 10
Any idea where I am going wrong?
Thanks,
Damian