Skip to content

Instantly share code, notes, and snippets.

@FugiTech
Created July 12, 2012 11:04
Show Gist options
  • Save FugiTech/3097463 to your computer and use it in GitHub Desktop.
Save FugiTech/3097463 to your computer and use it in GitHub Desktop.
Simple SockJS-TCP proxy in Twisted Python
from twisted.internet import reactor
from twisted.protocols.portforward import ProxyFactory
from txsockjs.factory import SockJSMultiFactory
pf = ProxyFactory('host', port)
ws = SockJSMultiFactory()
ws.addFactory(pf, "proxy")
reactor.listenTCP(8000, ws)
reactor.run()
#available on http://localhost:8000/proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment