Twisted

I'm just scribbling here. Maybe at some point this'll be a useful guide and not just a scratchpad.

You can run Twisted in your VPS! Caveats apply.

Create a virtualenv. Put Twisted in it:

$ ~/virtualenv/pip install Twisted

It should install fine. Now, start your Twisted application:

$ twistd web --port 8080 --wsgi my.wsgi.app

Or maybe

$ twistd my_custom_twisted_app --port 8080

And then proxy through nginx by putting the following in your nginx configuration for that site:

location / { proxy_pass http://localhost:8080/; }

You could also use a UNIX socket to keep the connection protected internally, but that won't work with WSGI or most Twisted Web apps due to bugs like http://twistedmatrix.com/trac/ticket/5406.

~ C.