replace localhost with 127.0.0.1 in all examples

This ensures we use IPv4 addresses; at least with Trollius
on Python 2.7 "localhost" can result in IPv6 addresses but
the examples are all currently written for IPv4
This commit is contained in:
meejah 2015-08-13 13:54:03 -06:00
parent 3fce8aca71
commit 8db76f8b2a
126 changed files with 130 additions and 130 deletions

View File

@ -21,7 +21,7 @@ class MyComponent(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -18,7 +18,7 @@ class MyComponent(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -51,7 +51,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -59,7 +59,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -60,7 +60,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -64,7 +64,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -55,7 +55,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -74,7 +74,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -61,7 +61,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -61,7 +61,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -60,7 +60,7 @@ if __name__ == '__main__':
options = ssl.create_default_context(cadata=open(cert_path, 'r').read())
# ...which we pass as "ssl=" to ApplicationRunner (passed to loop.create_connection)
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "wss://localhost:8083/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "wss://127.0.0.1:8083/ws"),
u"crossbardemo",
ssl=options, # try removing this, but still use self-signed cert
debug_wamp=False, # optional; log many WAMP details

View File

@ -76,7 +76,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -69,7 +69,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -86,7 +86,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -75,7 +75,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -61,7 +61,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -94,7 +94,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -91,7 +91,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -62,7 +62,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -60,7 +60,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -69,7 +69,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -53,7 +53,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -62,7 +62,7 @@ if __name__ == '__main__':
# Trollius >= 0.3 was renamed
import trollius as asyncio
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyClientProtocol
loop = asyncio.get_event_loop()

View File

@ -60,7 +60,7 @@ class MyClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyClientProtocol
loop = asyncio.get_event_loop()

View File

@ -57,7 +57,7 @@ class MyClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyClientProtocol
loop = trollius.get_event_loop()

View File

@ -57,7 +57,7 @@ if __name__ == '__main__':
# Trollius >= 0.3 was renamed
import trollius as asyncio
factory = WebSocketServerFactory("ws://localhost:9000", debug=False)
factory = WebSocketServerFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyServerProtocol
loop = asyncio.get_event_loop()

View File

@ -58,7 +58,7 @@ if __name__ == '__main__':
# Trollius >= 0.3 was renamed
import trollius as asyncio
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = SlowSquareClientProtocol
loop = asyncio.get_event_loop()

View File

@ -58,7 +58,7 @@ class SlowSquareServerProtocol(WebSocketServerProtocol):
if __name__ == '__main__':
factory = WebSocketServerFactory("ws://localhost:9000", debug=False)
factory = WebSocketServerFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = SlowSquareServerProtocol
loop = asyncio.get_event_loop()

View File

@ -55,7 +55,7 @@ class SlowSquareServerProtocol(WebSocketServerProtocol):
if __name__ == '__main__':
factory = WebSocketServerFactory("ws://localhost:9000", debug=False)
factory = WebSocketServerFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = SlowSquareServerProtocol
loop = trollius.get_event_loop()

View File

@ -91,7 +91,7 @@ if __name__ == '__main__':
# Trollius >= 0.3 was renamed
import trollius as asyncio
factory = TesteeServerFactory("ws://localhost:9002", debug=False)
factory = TesteeServerFactory("ws://127.0.0.1:9002", debug=False)
loop = asyncio.get_event_loop()
coro = loop.create_server(factory, port=9002)

View File

@ -102,7 +102,7 @@ if __name__ == '__main__':
from autobahn.twisted.wamp import ApplicationRunner
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -94,7 +94,7 @@ if __name__ == '__main__':
#
@run_in_reactor
def start_wamp():
wapp.run("ws://localhost:9000", "realm1", standalone=True, start_reactor=False)
wapp.run("ws://127.0.0.1:9000", "realm1", standalone=True, start_reactor=False)
start_wamp()

View File

@ -116,7 +116,7 @@ if __name__ == '__main__':
# run WAMP application component
##
from autobahn.twisted.wamp import ApplicationRunner
router = args.router or 'ws://localhost:9000'
router = args.router or 'ws://127.0.0.1:9000'
runner = ApplicationRunner(router, u"realm1", standalone=not args.router,
debug=False, # low-level logging

View File

@ -50,4 +50,4 @@ def onjoined():
if __name__ == "__main__":
app.run("ws://localhost:8080/ws", "realm1", standalone=True)
app.run("ws://127.0.0.1:8080/ws", "realm1", standalone=True)

View File

@ -111,7 +111,7 @@ if __name__ == '__main__':
# run WAMP application component
##
from autobahn.twisted.wamp import ApplicationRunner
router = args.router or 'ws://localhost:9000'
router = args.router or 'ws://127.0.0.1:9000'
runner = ApplicationRunner(router, u"realm1", standalone=not args.router,
debug=False, # low-level logging

View File

@ -36,4 +36,4 @@ def square(x):
if __name__ == "__main__":
app.run("ws://localhost:9000", "realm1", standalone=True)
app.run("ws://127.0.0.1:9000", "realm1", standalone=True)

View File

@ -48,4 +48,4 @@ if __name__ == "__main__":
log.startLogging(sys.stdout)
reactor.listenTCP(8080, Site(app.resource()))
wampapp.run("ws://localhost:9000", "realm1", standalone=False)
wampapp.run("ws://127.0.0.1:9000", "realm1", standalone=False)

View File

@ -80,4 +80,4 @@ if __name__ == "__main__":
log.startLogging(sys.stdout)
reactor.listenTCP(8080, Site(webapp.resource()))
wampapp.run("ws://localhost:9000", "realm1", standalone=True)
wampapp.run("ws://127.0.0.1:9000", "realm1", standalone=True)

View File

@ -161,7 +161,7 @@ if __name__ == '__main__':
# run WAMP application component
##
from autobahn.twisted.wamp import ApplicationRunner
router = args.router or 'ws://localhost:8080'
router = args.router or 'ws://127.0.0.1:8080'
runner = ApplicationRunner(router, u"realm1",
extra={'port': args.port, 'baudrate': args.baudrate, 'debug': args.debug},

View File

@ -46,4 +46,4 @@ def onjoined():
if __name__ == "__main__":
app.run("ws://localhost:8080/ws", "realm1", standalone=True)
app.run("ws://127.0.0.1:8080/ws", "realm1", standalone=True)

View File

@ -23,7 +23,7 @@ class MyComponent(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -19,7 +19,7 @@ class MyComponent(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -51,7 +51,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -62,7 +62,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
extra=dict(
max_events=5, # [A] pass in additional configuration

View File

@ -61,7 +61,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -68,7 +68,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -56,7 +56,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -70,7 +70,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -67,7 +67,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -64,7 +64,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -52,7 +52,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -72,7 +72,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -65,7 +65,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -85,7 +85,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -56,7 +56,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -88,7 +88,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -61,7 +61,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -93,7 +93,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -91,7 +91,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -62,7 +62,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -59,7 +59,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -60,7 +60,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -57,7 +57,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -58,7 +58,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -66,7 +66,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -55,7 +55,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -55,7 +55,7 @@ class Component(ApplicationSession):
if __name__ == '__main__':
runner = ApplicationRunner(
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://localhost:8080/ws"),
environ.get("AUTOBAHN_DEMO_ROUTER", "ws://127.0.0.1:8080/ws"),
u"crossbardemo",
debug_wamp=False, # optional; log many WAMP details
debug=False, # optional; log even more details

View File

@ -121,7 +121,7 @@ if __name__ == '__main__':
# test drive the component during development ..
runner = ApplicationRunner(
url="ws://localhost:8080/ws",
url="ws://127.0.0.1:8080/ws",
realm="realm1",
extra=extra,
debug=False, # low-level WebSocket debugging

View File

@ -230,7 +230,7 @@ if __name__ == '__main__':
print("Running Autobahn|Python {}".format(autobahn.version))
# our WebSocket server factory
factory = PersonaServerFactory("ws://localhost:8080")
factory = PersonaServerFactory("ws://127.0.0.1:8080")
# we serve static files under "/" ..
root = File(".")

View File

@ -53,7 +53,7 @@ class BroadcastClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
factory = WebSocketClientFactory(sys.argv[1])

View File

@ -112,7 +112,7 @@ if __name__ == '__main__':
ServerFactory = BroadcastServerFactory
# ServerFactory = BroadcastPreparedServerFactory
factory = ServerFactory("ws://localhost:9000",
factory = ServerFactory("ws://127.0.0.1:9000",
debug=debug,
debugCodePaths=debug)

View File

@ -63,7 +63,7 @@ if __name__ == '__main__':
log.startLogging(sys.stdout)
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyClientProtocol
reactor.connectTCP("127.0.0.1", 9000, factory)

View File

@ -70,7 +70,7 @@ if __name__ == '__main__':
log.startLogging(sys.stdout)
factory = WebSocketClientFactory("ws://localhost:9000", debug=False)
factory = WebSocketClientFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyClientProtocol
reactor.connectTCP("127.0.0.1", 9000, factory)

View File

@ -58,7 +58,7 @@ if __name__ == '__main__':
log.startLogging(sys.stdout)
factory = WebSocketServerFactory("ws://localhost:9000", debug=False)
factory = WebSocketServerFactory("ws://127.0.0.1:9000", debug=False)
factory.protocol = MyServerProtocol
# factory.setProtocolOptions(maxConnections=2)

View File

@ -59,7 +59,7 @@ class EchoClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
if len(sys.argv) > 2 and sys.argv[2] == 'debug':

View File

@ -56,7 +56,7 @@ class EchoClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Need the WebSocket server address, i.e. ws://localhost:9000"
print "Need the WebSocket server address, i.e. ws://127.0.0.1:9000"
sys.exit(1)
if len(sys.argv) > 2 and sys.argv[2] == 'debug':

View File

@ -59,7 +59,7 @@ if __name__ == '__main__':
else:
debug = False
factory = WebSocketServerFactory("ws://localhost:9000",
factory = WebSocketServerFactory("ws://127.0.0.1:9000",
debug=debug,
debugCodePaths=debug)

View File

@ -58,7 +58,7 @@ if __name__ == '__main__':
else:
debug = False
factory = WebSocketServerFactory("ws://localhost:9000",
factory = WebSocketServerFactory("ws://127.0.0.1:9000",
debug=debug,
debugCodePaths=debug)

View File

@ -72,11 +72,11 @@ if __name__ == '__main__':
parser.add_argument("-d", "--debug", action="store_true",
help="Enable debug output.")
parser.add_argument("--websocket", default="tcp:localhost:9000",
help='WebSocket client Twisted endpoint descriptor, e.g. "tcp:localhost:9000" or "unix:/tmp/mywebsocket".')
parser.add_argument("--websocket", default="tcp:127.0.0.1:9000",
help='WebSocket client Twisted endpoint descriptor, e.g. "tcp:127.0.0.1:9000" or "unix:/tmp/mywebsocket".')
parser.add_argument("--wsurl", default="ws://localhost:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://localhost:9000".')
parser.add_argument("--wsurl", default="ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://127.0.0.1:9000".')
args = parser.parse_args()

View File

@ -70,8 +70,8 @@ if __name__ == '__main__':
parser.add_argument("--websocket", default="tcp:9000",
help='WebSocket server Twisted endpoint descriptor, e.g. "tcp:9000" or "unix:/tmp/mywebsocket".')
parser.add_argument("--wsurl", default="ws://localhost:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://localhost:9000".')
parser.add_argument("--wsurl", default="ws://127.0.0.1:9000",
help='WebSocket URL (must suit the endpoint), e.g. "ws://127.0.0.1:9000".')
parser.add_argument("--web", default="tcp:8080",
help='Web server endpoint descriptor, e.g. "tcp:8080".')

View File

@ -54,7 +54,7 @@ class EchoClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
if len(sys.argv) > 2 and sys.argv[2] == 'debug':

View File

@ -65,7 +65,7 @@ if __name__ == '__main__':
headers = {'MyCustomServerHeader': 'Foobar'}
factory = WebSocketServerFactory("ws://localhost:9000",
factory = WebSocketServerFactory("ws://127.0.0.1:9000",
headers=headers,
debug=debug,
debugCodePaths=debug)

View File

@ -355,7 +355,7 @@ if __name__ == '__main__':
DEFAULT_WORKERS = psutil.NUM_CPUS
parser = argparse.ArgumentParser(description='Autobahn WebSocket Echo Multicore Server')
parser.add_argument('--wsuri', dest='wsuri', type=str, default='ws://localhost:9000', help='The WebSocket URI the server is listening on, e.g. ws://localhost:9000.')
parser.add_argument('--wsuri', dest='wsuri', type=str, default='ws://127.0.0.1:9000', help='The WebSocket URI the server is listening on, e.g. ws://localhost:9000.')
parser.add_argument('--port', dest='port', type=int, default=8080, help='Port to listen on for embedded Web server. Set to 0 to disable.')
parser.add_argument('--workers', dest='workers', type=int, default=DEFAULT_WORKERS, help='Number of workers to spawn - should fit the number of (physical) CPU cores.')
parser.add_argument('--noaffinity', dest='noaffinity', action="store_true", default=False, help='Do not set worker/CPU affinity.')

View File

@ -60,7 +60,7 @@ class EchoService(service.Service):
def startService(self):
factory = WebSocketServerFactory("ws://localhost:%d" % self.port, debug=self.debug)
factory = WebSocketServerFactory("ws://127.0.0.1:%d" % self.port, debug=self.debug)
factory.protocol = EchoServerProtocol
factory.setProtocolOptions(allowHixie76=True) # needed if Hixie76 is to be supported

View File

@ -55,7 +55,7 @@ if __name__ == '__main__':
else:
debug = False
factory = WebSocketServerFactory("ws://localhost:8080",
factory = WebSocketServerFactory("ws://127.0.0.1:8080",
debug=debug,
debugCodePaths=debug)

View File

@ -55,7 +55,7 @@ if __name__ == '__main__':
contextFactory = ssl.DefaultOpenSSLContextFactory('keys/server.key',
'keys/server.crt')
factory = WebSocketServerFactory("wss://localhost:8080",
factory = WebSocketServerFactory("wss://127.0.0.1:8080",
debug=debug,
debugCodePaths=debug)

View File

@ -54,7 +54,7 @@ if __name__ == '__main__':
log.startLogging(sys.stdout)
parser = OptionParser()
parser.add_option("-u", "--url", dest="url", help="The WebSocket URL", default="wss://localhost:9000")
parser.add_option("-u", "--url", dest="url", help="The WebSocket URL", default="wss://127.0.0.1:9000")
(options, args) = parser.parse_args()
# create a WS server factory with our protocol

View File

@ -56,7 +56,7 @@ if __name__ == '__main__':
contextFactory = ssl.DefaultOpenSSLContextFactory('keys/server.key',
'keys/server.crt')
factory = WebSocketServerFactory("wss://localhost:9000",
factory = WebSocketServerFactory("wss://127.0.0.1:9000",
debug=debug,
debugCodePaths=debug)

View File

@ -51,7 +51,7 @@ class EchoClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
if len(sys.argv) > 2 and sys.argv[2] == 'debug':

View File

@ -73,7 +73,7 @@ class EchoClientFactory(ReconnectingClientFactory, WebSocketClientFactory):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
if len(sys.argv) > 2 and sys.argv[2] == 'debug':

View File

@ -59,7 +59,7 @@ class EchoClientFactory(WebSocketClientFactory):
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Need the WebSocket server address, i.e. ws://localhost:9000"
print "Need the WebSocket server address, i.e. ws://127.0.0.1:9000"
sys.exit(1)
factory = EchoClientFactory(sys.argv[1])

View File

@ -51,7 +51,7 @@ class EchoClientProtocol(WebSocketClientProtocol):
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Need the WebSocket server address, i.e. ws://localhost:9000")
print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000")
sys.exit(1)
if len(sys.argv) < 3:

View File

@ -50,7 +50,7 @@ if __name__ == '__main__':
else:
debug = False
factory = WebSocketServerFactory("ws://localhost:9000",
factory = WebSocketServerFactory("ws://127.0.0.1:9000",
debug=debug,
debugCodePaths=debug)

Some files were not shown because too many files have changed in this diff Show More