Allow passing a bind interface to run-dev.py

This makes it simpler to test between two VMs by allowing you to bind to
non localhost interfaces.

(imported from commit f70755533b52ff8c49fd916941d2210fb8c33b47)
This commit is contained in:
Jason Michalski
2014-02-12 11:39:14 -05:00
parent f31b61ea5b
commit 97d4f2b009

View File

@@ -95,7 +95,11 @@ class Resource(resource.Resource):
return proxy.ReverseProxyResource('localhost', django_port, '/'+name)
try:
reactor.listenTCP(proxy_port, server.Site(Resource()), interface='127.0.0.1')
try:
interface = sys.argv[1]
except IndexError:
interface = '127.0.0.1'
reactor.listenTCP(proxy_port, server.Site(Resource()), interface=interface)
reactor.run()
except:
# Print the traceback before we get SIGTERM and die.