From 8db76f8b2a7d518c478cad3b988d2ed14bdb1327 Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 13 Aug 2015 13:54:03 -0600 Subject: [PATCH] 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 --- examples/asyncio/wamp/overview/backend.py | 2 +- examples/asyncio/wamp/overview/frontend.py | 2 +- examples/asyncio/wamp/pubsub/basic/backend.py | 2 +- examples/asyncio/wamp/pubsub/basic/frontend.py | 2 +- examples/asyncio/wamp/pubsub/complex/backend.py | 2 +- examples/asyncio/wamp/pubsub/complex/frontend.py | 2 +- examples/asyncio/wamp/pubsub/decorators/backend.py | 2 +- examples/asyncio/wamp/pubsub/decorators/frontend.py | 2 +- examples/asyncio/wamp/pubsub/options/backend.py | 2 +- examples/asyncio/wamp/pubsub/options/frontend.py | 2 +- examples/asyncio/wamp/pubsub/tls/backend_selfsigned.py | 2 +- examples/asyncio/wamp/pubsub/unsubscribe/frontend.py | 2 +- examples/asyncio/wamp/rpc/arguments/backend.py | 2 +- examples/asyncio/wamp/rpc/arguments/frontend.py | 2 +- examples/asyncio/wamp/rpc/complex/backend.py | 2 +- examples/asyncio/wamp/rpc/complex/frontend.py | 2 +- examples/asyncio/wamp/rpc/decorators/backend.py | 2 +- examples/asyncio/wamp/rpc/decorators/frontend.py | 2 +- examples/asyncio/wamp/rpc/errors/backend.py | 2 +- examples/asyncio/wamp/rpc/errors/frontend.py | 2 +- examples/asyncio/wamp/rpc/options/backend.py | 2 +- examples/asyncio/wamp/rpc/options/frontend.py | 2 +- examples/asyncio/wamp/rpc/progress/backend.py | 2 +- examples/asyncio/wamp/rpc/progress/frontend.py | 2 +- examples/asyncio/wamp/rpc/slowsquare/backend.py | 2 +- examples/asyncio/wamp/rpc/slowsquare/frontend.py | 2 +- examples/asyncio/wamp/rpc/timeservice/backend.py | 2 +- examples/asyncio/wamp/rpc/timeservice/frontend.py | 2 +- examples/asyncio/websocket/echo/client.py | 2 +- examples/asyncio/websocket/echo/client_coroutines.py | 2 +- examples/asyncio/websocket/echo/client_coroutines_py2.py | 2 +- examples/asyncio/websocket/echo/server.py | 2 +- examples/asyncio/websocket/slowsquare/client.py | 2 +- examples/asyncio/websocket/slowsquare/server.py | 2 +- examples/asyncio/websocket/slowsquare/server_py2.py | 2 +- examples/asyncio/websocket/testee/testee_server.py | 2 +- examples/twisted/wamp/app/calculator/calculator.py | 2 +- examples/twisted/wamp/app/crochet/example2/server.py | 2 +- examples/twisted/wamp/app/dbus/bridge.py | 2 +- examples/twisted/wamp/app/hello/hello.py | 2 +- examples/twisted/wamp/app/keyvalue/store.py | 2 +- examples/twisted/wamp/app/klein/example1/server_wamp.py | 2 +- examples/twisted/wamp/app/klein/example1/server_web.py | 2 +- examples/twisted/wamp/app/klein/example2/server.py | 2 +- examples/twisted/wamp/app/serial2ws/serial2ws.py | 2 +- .../wamp/app/subscribe_upon_call/subscribe_upon_call.py | 2 +- examples/twisted/wamp/overview/backend.py | 2 +- examples/twisted/wamp/overview/frontend.py | 2 +- examples/twisted/wamp/pubsub/basic/backend.py | 2 +- examples/twisted/wamp/pubsub/basic/frontend.py | 2 +- examples/twisted/wamp/pubsub/complex/backend.py | 2 +- examples/twisted/wamp/pubsub/complex/frontend.py | 2 +- examples/twisted/wamp/pubsub/decorators/backend.py | 2 +- examples/twisted/wamp/pubsub/decorators/frontend.py | 2 +- examples/twisted/wamp/pubsub/options/backend.py | 2 +- examples/twisted/wamp/pubsub/options/frontend.py | 2 +- examples/twisted/wamp/pubsub/unsubscribe/backend.py | 2 +- examples/twisted/wamp/pubsub/unsubscribe/frontend.py | 2 +- examples/twisted/wamp/rpc/arguments/backend.py | 2 +- examples/twisted/wamp/rpc/arguments/frontend.py | 2 +- examples/twisted/wamp/rpc/complex/backend.py | 2 +- examples/twisted/wamp/rpc/complex/frontend.py | 2 +- examples/twisted/wamp/rpc/decorators/backend.py | 2 +- examples/twisted/wamp/rpc/decorators/frontend.py | 2 +- examples/twisted/wamp/rpc/errors/backend.py | 2 +- examples/twisted/wamp/rpc/errors/frontend.py | 2 +- examples/twisted/wamp/rpc/options/backend.py | 2 +- examples/twisted/wamp/rpc/options/frontend.py | 2 +- examples/twisted/wamp/rpc/progress/backend.py | 2 +- examples/twisted/wamp/rpc/progress/frontend.py | 2 +- examples/twisted/wamp/rpc/slowsquare/backend.py | 2 +- examples/twisted/wamp/rpc/slowsquare/frontend.py | 2 +- examples/twisted/wamp/rpc/timeservice/backend.py | 2 +- examples/twisted/wamp/rpc/timeservice/frontend.py | 2 +- examples/twisted/wamp/wamplet/wampirc/wampirc/service.py | 2 +- examples/twisted/websocket/auth_persona/server.py | 2 +- examples/twisted/websocket/broadcast/client.py | 2 +- examples/twisted/websocket/broadcast/server.py | 2 +- examples/twisted/websocket/echo/client.py | 2 +- examples/twisted/websocket/echo/client_coroutines.py | 2 +- examples/twisted/websocket/echo/server.py | 2 +- examples/twisted/websocket/echo_compressed/client.py | 2 +- .../twisted/websocket/echo_compressed/client_advanced.py | 2 +- examples/twisted/websocket/echo_compressed/server.py | 2 +- .../twisted/websocket/echo_compressed/server_advanced.py | 2 +- examples/twisted/websocket/echo_endpoints/client.py | 8 ++++---- examples/twisted/websocket/echo_endpoints/server.py | 4 ++-- examples/twisted/websocket/echo_httpheaders/client.py | 2 +- examples/twisted/websocket/echo_httpheaders/server.py | 2 +- examples/twisted/websocket/echo_multicore/server.py | 2 +- .../twisted/websocket/echo_service/echows/echoservice.py | 2 +- examples/twisted/websocket/echo_site/server.py | 2 +- examples/twisted/websocket/echo_site_tls/server.py | 2 +- examples/twisted/websocket/echo_tls/client.py | 2 +- examples/twisted/websocket/echo_tls/server.py | 2 +- examples/twisted/websocket/echo_variants/client.py | 2 +- .../websocket/echo_variants/client_reconnecting.py | 2 +- .../twisted/websocket/echo_variants/client_with_params.py | 2 +- .../twisted/websocket/echo_variants/client_with_proxy.py | 2 +- examples/twisted/websocket/echo_variants/server.py | 2 +- examples/twisted/websocket/echo_wsfallbacks/server.py | 2 +- examples/twisted/websocket/echo_wsgi/server.py | 2 +- examples/twisted/websocket/multiproto/client.py | 2 +- examples/twisted/websocket/multiproto/server1.py | 2 +- examples/twisted/websocket/ping/client.py | 2 +- examples/twisted/websocket/ping/server.py | 2 +- examples/twisted/websocket/pingpong_keepalive/client.py | 2 +- examples/twisted/websocket/pingpong_keepalive/server.py | 2 +- examples/twisted/websocket/reconnecting/client.py | 2 +- examples/twisted/websocket/reconnecting/server.py | 2 +- examples/twisted/websocket/slowsquare/client.py | 2 +- examples/twisted/websocket/slowsquare/server.py | 2 +- .../twisted/websocket/streaming/frame_based_client.py | 2 +- .../twisted/websocket/streaming/frame_based_server.py | 2 +- .../twisted/websocket/streaming/message_based_client.py | 2 +- .../twisted/websocket/streaming/message_based_server.py | 2 +- examples/twisted/websocket/streaming/streaming_client.py | 2 +- .../websocket/streaming/streaming_producer_client.py | 2 +- examples/twisted/websocket/streaming/streaming_server.py | 2 +- examples/twisted/websocket/testee/testee_server.py | 2 +- examples/twisted/websocket/wrapping/client.py | 2 +- examples/twisted/websocket/wrapping/client_endpoint.py | 2 +- examples/twisted/websocket/wrapping/server.py | 2 +- examples/twisted/websocket/wrapping/server_endpoint.py | 2 +- examples/twisted/websocket/wxpython/client.py | 2 +- examples/twisted/websocket/wxpython/server.py | 2 +- 126 files changed, 130 insertions(+), 130 deletions(-) diff --git a/examples/asyncio/wamp/overview/backend.py b/examples/asyncio/wamp/overview/backend.py index c2c82d51..000cfb78 100644 --- a/examples/asyncio/wamp/overview/backend.py +++ b/examples/asyncio/wamp/overview/backend.py @@ -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 diff --git a/examples/asyncio/wamp/overview/frontend.py b/examples/asyncio/wamp/overview/frontend.py index 872d8e35..dbc9b4b1 100644 --- a/examples/asyncio/wamp/overview/frontend.py +++ b/examples/asyncio/wamp/overview/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/basic/backend.py b/examples/asyncio/wamp/pubsub/basic/backend.py index bfcc25fe..25979452 100644 --- a/examples/asyncio/wamp/pubsub/basic/backend.py +++ b/examples/asyncio/wamp/pubsub/basic/backend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/basic/frontend.py b/examples/asyncio/wamp/pubsub/basic/frontend.py index d9fabbd9..96e8e45f 100644 --- a/examples/asyncio/wamp/pubsub/basic/frontend.py +++ b/examples/asyncio/wamp/pubsub/basic/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/complex/backend.py b/examples/asyncio/wamp/pubsub/complex/backend.py index 37f7bb11..2a698597 100644 --- a/examples/asyncio/wamp/pubsub/complex/backend.py +++ b/examples/asyncio/wamp/pubsub/complex/backend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/complex/frontend.py b/examples/asyncio/wamp/pubsub/complex/frontend.py index 5f72f85e..bc3eddfe 100644 --- a/examples/asyncio/wamp/pubsub/complex/frontend.py +++ b/examples/asyncio/wamp/pubsub/complex/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/decorators/backend.py b/examples/asyncio/wamp/pubsub/decorators/backend.py index 172f19a0..e8aa3621 100644 --- a/examples/asyncio/wamp/pubsub/decorators/backend.py +++ b/examples/asyncio/wamp/pubsub/decorators/backend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/decorators/frontend.py b/examples/asyncio/wamp/pubsub/decorators/frontend.py index 0f149b45..1823cfff 100644 --- a/examples/asyncio/wamp/pubsub/decorators/frontend.py +++ b/examples/asyncio/wamp/pubsub/decorators/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/options/backend.py b/examples/asyncio/wamp/pubsub/options/backend.py index 7c94d262..312f3d41 100644 --- a/examples/asyncio/wamp/pubsub/options/backend.py +++ b/examples/asyncio/wamp/pubsub/options/backend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/options/frontend.py b/examples/asyncio/wamp/pubsub/options/frontend.py index 46fcefb3..24c660b9 100644 --- a/examples/asyncio/wamp/pubsub/options/frontend.py +++ b/examples/asyncio/wamp/pubsub/options/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/tls/backend_selfsigned.py b/examples/asyncio/wamp/pubsub/tls/backend_selfsigned.py index 11c32629..b587ed37 100644 --- a/examples/asyncio/wamp/pubsub/tls/backend_selfsigned.py +++ b/examples/asyncio/wamp/pubsub/tls/backend_selfsigned.py @@ -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 diff --git a/examples/asyncio/wamp/pubsub/unsubscribe/frontend.py b/examples/asyncio/wamp/pubsub/unsubscribe/frontend.py index ed8a28d5..f360570d 100644 --- a/examples/asyncio/wamp/pubsub/unsubscribe/frontend.py +++ b/examples/asyncio/wamp/pubsub/unsubscribe/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/arguments/backend.py b/examples/asyncio/wamp/rpc/arguments/backend.py index 4b255160..60ade969 100644 --- a/examples/asyncio/wamp/rpc/arguments/backend.py +++ b/examples/asyncio/wamp/rpc/arguments/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/arguments/frontend.py b/examples/asyncio/wamp/rpc/arguments/frontend.py index 7d8c849d..a3f7e33b 100644 --- a/examples/asyncio/wamp/rpc/arguments/frontend.py +++ b/examples/asyncio/wamp/rpc/arguments/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/complex/backend.py b/examples/asyncio/wamp/rpc/complex/backend.py index 3ab6b1ef..2bda828c 100644 --- a/examples/asyncio/wamp/rpc/complex/backend.py +++ b/examples/asyncio/wamp/rpc/complex/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/complex/frontend.py b/examples/asyncio/wamp/rpc/complex/frontend.py index 9eaabac6..50809e9a 100644 --- a/examples/asyncio/wamp/rpc/complex/frontend.py +++ b/examples/asyncio/wamp/rpc/complex/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/decorators/backend.py b/examples/asyncio/wamp/rpc/decorators/backend.py index 9d09645d..f02df5b0 100644 --- a/examples/asyncio/wamp/rpc/decorators/backend.py +++ b/examples/asyncio/wamp/rpc/decorators/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/decorators/frontend.py b/examples/asyncio/wamp/rpc/decorators/frontend.py index 6ab88a4f..5ece0d58 100644 --- a/examples/asyncio/wamp/rpc/decorators/frontend.py +++ b/examples/asyncio/wamp/rpc/decorators/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/errors/backend.py b/examples/asyncio/wamp/rpc/errors/backend.py index 364b946f..fe5316bc 100644 --- a/examples/asyncio/wamp/rpc/errors/backend.py +++ b/examples/asyncio/wamp/rpc/errors/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/errors/frontend.py b/examples/asyncio/wamp/rpc/errors/frontend.py index fb210227..e536b293 100644 --- a/examples/asyncio/wamp/rpc/errors/frontend.py +++ b/examples/asyncio/wamp/rpc/errors/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/options/backend.py b/examples/asyncio/wamp/rpc/options/backend.py index 89efb5dd..22813174 100644 --- a/examples/asyncio/wamp/rpc/options/backend.py +++ b/examples/asyncio/wamp/rpc/options/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/options/frontend.py b/examples/asyncio/wamp/rpc/options/frontend.py index 74a8ad31..54492813 100644 --- a/examples/asyncio/wamp/rpc/options/frontend.py +++ b/examples/asyncio/wamp/rpc/options/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/progress/backend.py b/examples/asyncio/wamp/rpc/progress/backend.py index 669fdc07..4a5bec42 100644 --- a/examples/asyncio/wamp/rpc/progress/backend.py +++ b/examples/asyncio/wamp/rpc/progress/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/progress/frontend.py b/examples/asyncio/wamp/rpc/progress/frontend.py index cbeeeb9f..43e87a50 100644 --- a/examples/asyncio/wamp/rpc/progress/frontend.py +++ b/examples/asyncio/wamp/rpc/progress/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/slowsquare/backend.py b/examples/asyncio/wamp/rpc/slowsquare/backend.py index 351911e4..6c633d59 100644 --- a/examples/asyncio/wamp/rpc/slowsquare/backend.py +++ b/examples/asyncio/wamp/rpc/slowsquare/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/slowsquare/frontend.py b/examples/asyncio/wamp/rpc/slowsquare/frontend.py index bcf4fb65..53cf7ca1 100644 --- a/examples/asyncio/wamp/rpc/slowsquare/frontend.py +++ b/examples/asyncio/wamp/rpc/slowsquare/frontend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/timeservice/backend.py b/examples/asyncio/wamp/rpc/timeservice/backend.py index bea73ea7..ecb70d08 100644 --- a/examples/asyncio/wamp/rpc/timeservice/backend.py +++ b/examples/asyncio/wamp/rpc/timeservice/backend.py @@ -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 diff --git a/examples/asyncio/wamp/rpc/timeservice/frontend.py b/examples/asyncio/wamp/rpc/timeservice/frontend.py index 24969852..be2254a3 100644 --- a/examples/asyncio/wamp/rpc/timeservice/frontend.py +++ b/examples/asyncio/wamp/rpc/timeservice/frontend.py @@ -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 diff --git a/examples/asyncio/websocket/echo/client.py b/examples/asyncio/websocket/echo/client.py index 2fa95f6a..6acc73b5 100644 --- a/examples/asyncio/websocket/echo/client.py +++ b/examples/asyncio/websocket/echo/client.py @@ -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() diff --git a/examples/asyncio/websocket/echo/client_coroutines.py b/examples/asyncio/websocket/echo/client_coroutines.py index 8afb5cbc..68e881bf 100644 --- a/examples/asyncio/websocket/echo/client_coroutines.py +++ b/examples/asyncio/websocket/echo/client_coroutines.py @@ -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() diff --git a/examples/asyncio/websocket/echo/client_coroutines_py2.py b/examples/asyncio/websocket/echo/client_coroutines_py2.py index ad572cb8..ebbbc7ee 100644 --- a/examples/asyncio/websocket/echo/client_coroutines_py2.py +++ b/examples/asyncio/websocket/echo/client_coroutines_py2.py @@ -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() diff --git a/examples/asyncio/websocket/echo/server.py b/examples/asyncio/websocket/echo/server.py index 690d841e..d9ef4d15 100644 --- a/examples/asyncio/websocket/echo/server.py +++ b/examples/asyncio/websocket/echo/server.py @@ -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() diff --git a/examples/asyncio/websocket/slowsquare/client.py b/examples/asyncio/websocket/slowsquare/client.py index 0891033a..4eb13125 100644 --- a/examples/asyncio/websocket/slowsquare/client.py +++ b/examples/asyncio/websocket/slowsquare/client.py @@ -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() diff --git a/examples/asyncio/websocket/slowsquare/server.py b/examples/asyncio/websocket/slowsquare/server.py index 1bb9f287..046945e1 100644 --- a/examples/asyncio/websocket/slowsquare/server.py +++ b/examples/asyncio/websocket/slowsquare/server.py @@ -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() diff --git a/examples/asyncio/websocket/slowsquare/server_py2.py b/examples/asyncio/websocket/slowsquare/server_py2.py index 39f0c92f..c89978db 100644 --- a/examples/asyncio/websocket/slowsquare/server_py2.py +++ b/examples/asyncio/websocket/slowsquare/server_py2.py @@ -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() diff --git a/examples/asyncio/websocket/testee/testee_server.py b/examples/asyncio/websocket/testee/testee_server.py index 3f69875d..36a3182f 100644 --- a/examples/asyncio/websocket/testee/testee_server.py +++ b/examples/asyncio/websocket/testee/testee_server.py @@ -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) diff --git a/examples/twisted/wamp/app/calculator/calculator.py b/examples/twisted/wamp/app/calculator/calculator.py index 355f48b6..3aaad395 100644 --- a/examples/twisted/wamp/app/calculator/calculator.py +++ b/examples/twisted/wamp/app/calculator/calculator.py @@ -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 diff --git a/examples/twisted/wamp/app/crochet/example2/server.py b/examples/twisted/wamp/app/crochet/example2/server.py index bc4c59f5..3631eab6 100644 --- a/examples/twisted/wamp/app/crochet/example2/server.py +++ b/examples/twisted/wamp/app/crochet/example2/server.py @@ -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() diff --git a/examples/twisted/wamp/app/dbus/bridge.py b/examples/twisted/wamp/app/dbus/bridge.py index 11a1a080..4dab02ab 100644 --- a/examples/twisted/wamp/app/dbus/bridge.py +++ b/examples/twisted/wamp/app/dbus/bridge.py @@ -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 diff --git a/examples/twisted/wamp/app/hello/hello.py b/examples/twisted/wamp/app/hello/hello.py index 1422059a..eb9d6bdb 100644 --- a/examples/twisted/wamp/app/hello/hello.py +++ b/examples/twisted/wamp/app/hello/hello.py @@ -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) diff --git a/examples/twisted/wamp/app/keyvalue/store.py b/examples/twisted/wamp/app/keyvalue/store.py index 665ca196..b37fdcb5 100644 --- a/examples/twisted/wamp/app/keyvalue/store.py +++ b/examples/twisted/wamp/app/keyvalue/store.py @@ -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 diff --git a/examples/twisted/wamp/app/klein/example1/server_wamp.py b/examples/twisted/wamp/app/klein/example1/server_wamp.py index 7a8acff9..cccf9bc5 100644 --- a/examples/twisted/wamp/app/klein/example1/server_wamp.py +++ b/examples/twisted/wamp/app/klein/example1/server_wamp.py @@ -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) diff --git a/examples/twisted/wamp/app/klein/example1/server_web.py b/examples/twisted/wamp/app/klein/example1/server_web.py index 678b16d2..f29b7eb4 100644 --- a/examples/twisted/wamp/app/klein/example1/server_web.py +++ b/examples/twisted/wamp/app/klein/example1/server_web.py @@ -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) diff --git a/examples/twisted/wamp/app/klein/example2/server.py b/examples/twisted/wamp/app/klein/example2/server.py index 392e3f69..46bbbbf8 100644 --- a/examples/twisted/wamp/app/klein/example2/server.py +++ b/examples/twisted/wamp/app/klein/example2/server.py @@ -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) diff --git a/examples/twisted/wamp/app/serial2ws/serial2ws.py b/examples/twisted/wamp/app/serial2ws/serial2ws.py index 9e05daab..0a105d1c 100644 --- a/examples/twisted/wamp/app/serial2ws/serial2ws.py +++ b/examples/twisted/wamp/app/serial2ws/serial2ws.py @@ -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}, diff --git a/examples/twisted/wamp/app/subscribe_upon_call/subscribe_upon_call.py b/examples/twisted/wamp/app/subscribe_upon_call/subscribe_upon_call.py index 02a8c4fc..e96ab5b5 100644 --- a/examples/twisted/wamp/app/subscribe_upon_call/subscribe_upon_call.py +++ b/examples/twisted/wamp/app/subscribe_upon_call/subscribe_upon_call.py @@ -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) diff --git a/examples/twisted/wamp/overview/backend.py b/examples/twisted/wamp/overview/backend.py index 911b89cc..e8dda49c 100644 --- a/examples/twisted/wamp/overview/backend.py +++ b/examples/twisted/wamp/overview/backend.py @@ -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 diff --git a/examples/twisted/wamp/overview/frontend.py b/examples/twisted/wamp/overview/frontend.py index ed7035de..28ff6e22 100644 --- a/examples/twisted/wamp/overview/frontend.py +++ b/examples/twisted/wamp/overview/frontend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/basic/backend.py b/examples/twisted/wamp/pubsub/basic/backend.py index a4faeff4..875ce4e4 100644 --- a/examples/twisted/wamp/pubsub/basic/backend.py +++ b/examples/twisted/wamp/pubsub/basic/backend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/basic/frontend.py b/examples/twisted/wamp/pubsub/basic/frontend.py index a16d4fe3..3eca849e 100644 --- a/examples/twisted/wamp/pubsub/basic/frontend.py +++ b/examples/twisted/wamp/pubsub/basic/frontend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/complex/backend.py b/examples/twisted/wamp/pubsub/complex/backend.py index dc9e1aa4..b75c62fa 100644 --- a/examples/twisted/wamp/pubsub/complex/backend.py +++ b/examples/twisted/wamp/pubsub/complex/backend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/complex/frontend.py b/examples/twisted/wamp/pubsub/complex/frontend.py index 158b6ef5..d78b58b5 100644 --- a/examples/twisted/wamp/pubsub/complex/frontend.py +++ b/examples/twisted/wamp/pubsub/complex/frontend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/decorators/backend.py b/examples/twisted/wamp/pubsub/decorators/backend.py index 80d4d69c..48598e1a 100644 --- a/examples/twisted/wamp/pubsub/decorators/backend.py +++ b/examples/twisted/wamp/pubsub/decorators/backend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/decorators/frontend.py b/examples/twisted/wamp/pubsub/decorators/frontend.py index c6ca07e2..f3778de1 100644 --- a/examples/twisted/wamp/pubsub/decorators/frontend.py +++ b/examples/twisted/wamp/pubsub/decorators/frontend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/options/backend.py b/examples/twisted/wamp/pubsub/options/backend.py index ed509ec2..0e9103f5 100644 --- a/examples/twisted/wamp/pubsub/options/backend.py +++ b/examples/twisted/wamp/pubsub/options/backend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/options/frontend.py b/examples/twisted/wamp/pubsub/options/frontend.py index f825203d..31773dc7 100644 --- a/examples/twisted/wamp/pubsub/options/frontend.py +++ b/examples/twisted/wamp/pubsub/options/frontend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/unsubscribe/backend.py b/examples/twisted/wamp/pubsub/unsubscribe/backend.py index 7616b46d..5f1d0240 100644 --- a/examples/twisted/wamp/pubsub/unsubscribe/backend.py +++ b/examples/twisted/wamp/pubsub/unsubscribe/backend.py @@ -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 diff --git a/examples/twisted/wamp/pubsub/unsubscribe/frontend.py b/examples/twisted/wamp/pubsub/unsubscribe/frontend.py index 5f75ef35..ae37308d 100644 --- a/examples/twisted/wamp/pubsub/unsubscribe/frontend.py +++ b/examples/twisted/wamp/pubsub/unsubscribe/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/arguments/backend.py b/examples/twisted/wamp/rpc/arguments/backend.py index fbc3c0b4..6a144bf6 100644 --- a/examples/twisted/wamp/rpc/arguments/backend.py +++ b/examples/twisted/wamp/rpc/arguments/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/arguments/frontend.py b/examples/twisted/wamp/rpc/arguments/frontend.py index eb219bdb..1529d111 100644 --- a/examples/twisted/wamp/rpc/arguments/frontend.py +++ b/examples/twisted/wamp/rpc/arguments/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/complex/backend.py b/examples/twisted/wamp/rpc/complex/backend.py index fdb200db..51765aa9 100644 --- a/examples/twisted/wamp/rpc/complex/backend.py +++ b/examples/twisted/wamp/rpc/complex/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/complex/frontend.py b/examples/twisted/wamp/rpc/complex/frontend.py index c81c11fc..3f513895 100644 --- a/examples/twisted/wamp/rpc/complex/frontend.py +++ b/examples/twisted/wamp/rpc/complex/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/decorators/backend.py b/examples/twisted/wamp/rpc/decorators/backend.py index e4c16dc1..f571e864 100644 --- a/examples/twisted/wamp/rpc/decorators/backend.py +++ b/examples/twisted/wamp/rpc/decorators/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/decorators/frontend.py b/examples/twisted/wamp/rpc/decorators/frontend.py index 3cb21924..ac41d9e2 100644 --- a/examples/twisted/wamp/rpc/decorators/frontend.py +++ b/examples/twisted/wamp/rpc/decorators/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/errors/backend.py b/examples/twisted/wamp/rpc/errors/backend.py index b92f14ca..3a5b228f 100644 --- a/examples/twisted/wamp/rpc/errors/backend.py +++ b/examples/twisted/wamp/rpc/errors/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/errors/frontend.py b/examples/twisted/wamp/rpc/errors/frontend.py index 81f84072..61dd92e7 100644 --- a/examples/twisted/wamp/rpc/errors/frontend.py +++ b/examples/twisted/wamp/rpc/errors/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/options/backend.py b/examples/twisted/wamp/rpc/options/backend.py index 579794fe..20c82c33 100644 --- a/examples/twisted/wamp/rpc/options/backend.py +++ b/examples/twisted/wamp/rpc/options/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/options/frontend.py b/examples/twisted/wamp/rpc/options/frontend.py index fb7e0ac6..946df70a 100644 --- a/examples/twisted/wamp/rpc/options/frontend.py +++ b/examples/twisted/wamp/rpc/options/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/progress/backend.py b/examples/twisted/wamp/rpc/progress/backend.py index 11c8a6e3..4b71814f 100644 --- a/examples/twisted/wamp/rpc/progress/backend.py +++ b/examples/twisted/wamp/rpc/progress/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/progress/frontend.py b/examples/twisted/wamp/rpc/progress/frontend.py index a5f175df..00c6b3d5 100644 --- a/examples/twisted/wamp/rpc/progress/frontend.py +++ b/examples/twisted/wamp/rpc/progress/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/slowsquare/backend.py b/examples/twisted/wamp/rpc/slowsquare/backend.py index 673546cc..beb1a319 100644 --- a/examples/twisted/wamp/rpc/slowsquare/backend.py +++ b/examples/twisted/wamp/rpc/slowsquare/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/slowsquare/frontend.py b/examples/twisted/wamp/rpc/slowsquare/frontend.py index 47042523..3e2b6904 100644 --- a/examples/twisted/wamp/rpc/slowsquare/frontend.py +++ b/examples/twisted/wamp/rpc/slowsquare/frontend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/timeservice/backend.py b/examples/twisted/wamp/rpc/timeservice/backend.py index f1a07b06..a61eb854 100644 --- a/examples/twisted/wamp/rpc/timeservice/backend.py +++ b/examples/twisted/wamp/rpc/timeservice/backend.py @@ -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 diff --git a/examples/twisted/wamp/rpc/timeservice/frontend.py b/examples/twisted/wamp/rpc/timeservice/frontend.py index 8417ccb8..8f8f07d5 100644 --- a/examples/twisted/wamp/rpc/timeservice/frontend.py +++ b/examples/twisted/wamp/rpc/timeservice/frontend.py @@ -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 diff --git a/examples/twisted/wamp/wamplet/wampirc/wampirc/service.py b/examples/twisted/wamp/wamplet/wampirc/wampirc/service.py index a78c8364..c56c8e14 100644 --- a/examples/twisted/wamp/wamplet/wampirc/wampirc/service.py +++ b/examples/twisted/wamp/wamplet/wampirc/wampirc/service.py @@ -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 diff --git a/examples/twisted/websocket/auth_persona/server.py b/examples/twisted/websocket/auth_persona/server.py index 3a49bac1..e5070cd1 100644 --- a/examples/twisted/websocket/auth_persona/server.py +++ b/examples/twisted/websocket/auth_persona/server.py @@ -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(".") diff --git a/examples/twisted/websocket/broadcast/client.py b/examples/twisted/websocket/broadcast/client.py index 59c1e08d..337e0720 100644 --- a/examples/twisted/websocket/broadcast/client.py +++ b/examples/twisted/websocket/broadcast/client.py @@ -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]) diff --git a/examples/twisted/websocket/broadcast/server.py b/examples/twisted/websocket/broadcast/server.py index 906f2210..6d15ad86 100644 --- a/examples/twisted/websocket/broadcast/server.py +++ b/examples/twisted/websocket/broadcast/server.py @@ -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) diff --git a/examples/twisted/websocket/echo/client.py b/examples/twisted/websocket/echo/client.py index 19cb14ec..5f453964 100644 --- a/examples/twisted/websocket/echo/client.py +++ b/examples/twisted/websocket/echo/client.py @@ -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) diff --git a/examples/twisted/websocket/echo/client_coroutines.py b/examples/twisted/websocket/echo/client_coroutines.py index d5899f55..79911937 100644 --- a/examples/twisted/websocket/echo/client_coroutines.py +++ b/examples/twisted/websocket/echo/client_coroutines.py @@ -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) diff --git a/examples/twisted/websocket/echo/server.py b/examples/twisted/websocket/echo/server.py index 066cea76..a859dd1b 100644 --- a/examples/twisted/websocket/echo/server.py +++ b/examples/twisted/websocket/echo/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_compressed/client.py b/examples/twisted/websocket/echo_compressed/client.py index 219d9c3c..44dc1151 100644 --- a/examples/twisted/websocket/echo_compressed/client.py +++ b/examples/twisted/websocket/echo_compressed/client.py @@ -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': diff --git a/examples/twisted/websocket/echo_compressed/client_advanced.py b/examples/twisted/websocket/echo_compressed/client_advanced.py index 3e7a5b97..68fd3cc2 100644 --- a/examples/twisted/websocket/echo_compressed/client_advanced.py +++ b/examples/twisted/websocket/echo_compressed/client_advanced.py @@ -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': diff --git a/examples/twisted/websocket/echo_compressed/server.py b/examples/twisted/websocket/echo_compressed/server.py index 9f1a2f7b..a947cd41 100644 --- a/examples/twisted/websocket/echo_compressed/server.py +++ b/examples/twisted/websocket/echo_compressed/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_compressed/server_advanced.py b/examples/twisted/websocket/echo_compressed/server_advanced.py index 1bc3f5d2..4200dbcb 100644 --- a/examples/twisted/websocket/echo_compressed/server_advanced.py +++ b/examples/twisted/websocket/echo_compressed/server_advanced.py @@ -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) diff --git a/examples/twisted/websocket/echo_endpoints/client.py b/examples/twisted/websocket/echo_endpoints/client.py index de04db2f..819699ca 100644 --- a/examples/twisted/websocket/echo_endpoints/client.py +++ b/examples/twisted/websocket/echo_endpoints/client.py @@ -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() diff --git a/examples/twisted/websocket/echo_endpoints/server.py b/examples/twisted/websocket/echo_endpoints/server.py index 1b1555cb..af8a4aef 100644 --- a/examples/twisted/websocket/echo_endpoints/server.py +++ b/examples/twisted/websocket/echo_endpoints/server.py @@ -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".') diff --git a/examples/twisted/websocket/echo_httpheaders/client.py b/examples/twisted/websocket/echo_httpheaders/client.py index 0e5dfede..14725842 100644 --- a/examples/twisted/websocket/echo_httpheaders/client.py +++ b/examples/twisted/websocket/echo_httpheaders/client.py @@ -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': diff --git a/examples/twisted/websocket/echo_httpheaders/server.py b/examples/twisted/websocket/echo_httpheaders/server.py index 7e64d3ad..046ce263 100644 --- a/examples/twisted/websocket/echo_httpheaders/server.py +++ b/examples/twisted/websocket/echo_httpheaders/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_multicore/server.py b/examples/twisted/websocket/echo_multicore/server.py index 16cb0af0..88312c12 100644 --- a/examples/twisted/websocket/echo_multicore/server.py +++ b/examples/twisted/websocket/echo_multicore/server.py @@ -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.') diff --git a/examples/twisted/websocket/echo_service/echows/echoservice.py b/examples/twisted/websocket/echo_service/echows/echoservice.py index 145867d8..528921da 100644 --- a/examples/twisted/websocket/echo_service/echows/echoservice.py +++ b/examples/twisted/websocket/echo_service/echows/echoservice.py @@ -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 diff --git a/examples/twisted/websocket/echo_site/server.py b/examples/twisted/websocket/echo_site/server.py index 7d048070..d055d7f8 100644 --- a/examples/twisted/websocket/echo_site/server.py +++ b/examples/twisted/websocket/echo_site/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_site_tls/server.py b/examples/twisted/websocket/echo_site_tls/server.py index a5a43b73..c718b459 100644 --- a/examples/twisted/websocket/echo_site_tls/server.py +++ b/examples/twisted/websocket/echo_site_tls/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_tls/client.py b/examples/twisted/websocket/echo_tls/client.py index 331fdef0..55af03f8 100644 --- a/examples/twisted/websocket/echo_tls/client.py +++ b/examples/twisted/websocket/echo_tls/client.py @@ -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 diff --git a/examples/twisted/websocket/echo_tls/server.py b/examples/twisted/websocket/echo_tls/server.py index 231cd1a3..42ce15f1 100644 --- a/examples/twisted/websocket/echo_tls/server.py +++ b/examples/twisted/websocket/echo_tls/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_variants/client.py b/examples/twisted/websocket/echo_variants/client.py index 14900bad..8bb6a212 100644 --- a/examples/twisted/websocket/echo_variants/client.py +++ b/examples/twisted/websocket/echo_variants/client.py @@ -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': diff --git a/examples/twisted/websocket/echo_variants/client_reconnecting.py b/examples/twisted/websocket/echo_variants/client_reconnecting.py index e2a5ddcc..5b6ac12a 100644 --- a/examples/twisted/websocket/echo_variants/client_reconnecting.py +++ b/examples/twisted/websocket/echo_variants/client_reconnecting.py @@ -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': diff --git a/examples/twisted/websocket/echo_variants/client_with_params.py b/examples/twisted/websocket/echo_variants/client_with_params.py index 394e185e..c2ac5ddb 100644 --- a/examples/twisted/websocket/echo_variants/client_with_params.py +++ b/examples/twisted/websocket/echo_variants/client_with_params.py @@ -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]) diff --git a/examples/twisted/websocket/echo_variants/client_with_proxy.py b/examples/twisted/websocket/echo_variants/client_with_proxy.py index aa858223..46e8d247 100644 --- a/examples/twisted/websocket/echo_variants/client_with_proxy.py +++ b/examples/twisted/websocket/echo_variants/client_with_proxy.py @@ -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: diff --git a/examples/twisted/websocket/echo_variants/server.py b/examples/twisted/websocket/echo_variants/server.py index a937efba..8223aab3 100644 --- a/examples/twisted/websocket/echo_variants/server.py +++ b/examples/twisted/websocket/echo_variants/server.py @@ -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) diff --git a/examples/twisted/websocket/echo_wsfallbacks/server.py b/examples/twisted/websocket/echo_wsfallbacks/server.py index 53a38248..685a48b4 100644 --- a/examples/twisted/websocket/echo_wsfallbacks/server.py +++ b/examples/twisted/websocket/echo_wsfallbacks/server.py @@ -56,7 +56,7 @@ if __name__ == '__main__': # Our WebSocket server ## - factory = WebSocketServerFactory("ws://localhost:%d" % wsPort, + factory = WebSocketServerFactory("ws://127.0.0.1:%d" % wsPort, debug=debug, debugCodePaths=debug) diff --git a/examples/twisted/websocket/echo_wsgi/server.py b/examples/twisted/websocket/echo_wsgi/server.py index 2a0a8879..43bfd8bf 100644 --- a/examples/twisted/websocket/echo_wsgi/server.py +++ b/examples/twisted/websocket/echo_wsgi/server.py @@ -78,7 +78,7 @@ if __name__ == "__main__": ## # create a Twisted Web resource for our WebSocket server ## - wsFactory = WebSocketServerFactory("ws://localhost:8080", + wsFactory = WebSocketServerFactory("ws://127.0.0.1:8080", debug=debug, debugCodePaths=debug) diff --git a/examples/twisted/websocket/multiproto/client.py b/examples/twisted/websocket/multiproto/client.py index d3b98e66..8d9f0ac5 100644 --- a/examples/twisted/websocket/multiproto/client.py +++ b/examples/twisted/websocket/multiproto/client.py @@ -67,7 +67,7 @@ class EchoClientFactory(WebSocketClientFactory): if __name__ == '__main__': if len(sys.argv) < 2: - print("Need the WebSocket server address, i.e. ws://localhost:9000/echo1") + print("Need the WebSocket server address, i.e. ws://127.0.0.1:9000/echo1") sys.exit(1) factory = EchoClientFactory(sys.argv[1]) diff --git a/examples/twisted/websocket/multiproto/server1.py b/examples/twisted/websocket/multiproto/server1.py index 7367c991..dd617349 100644 --- a/examples/twisted/websocket/multiproto/server1.py +++ b/examples/twisted/websocket/multiproto/server1.py @@ -132,7 +132,7 @@ class ServiceServerProtocol(WebSocketServerProtocol): if __name__ == '__main__': - factory = WebSocketServerFactory("ws://localhost:9000") + factory = WebSocketServerFactory("ws://127.0.0.1:9000") factory.protocol = ServiceServerProtocol listenWS(factory) diff --git a/examples/twisted/websocket/ping/client.py b/examples/twisted/websocket/ping/client.py index 4d9d87c0..9b32fccc 100644 --- a/examples/twisted/websocket/ping/client.py +++ b/examples/twisted/websocket/ping/client.py @@ -56,7 +56,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) 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], debug='debug' in sys.argv) diff --git a/examples/twisted/websocket/ping/server.py b/examples/twisted/websocket/ping/server.py index d730d807..9aaa70e3 100644 --- a/examples/twisted/websocket/ping/server.py +++ b/examples/twisted/websocket/ping/server.py @@ -76,7 +76,7 @@ if __name__ == '__main__': contextFactory = ssl.DefaultOpenSSLContextFactory('keys/server.key', 'keys/server.crt') - factory = PingServerFactory("wss://localhost:9000", + factory = PingServerFactory("wss://127.0.0.1:9000", debug='debug' in sys.argv) factory.protocol = PingServerProtocol diff --git a/examples/twisted/websocket/pingpong_keepalive/client.py b/examples/twisted/websocket/pingpong_keepalive/client.py index e4f29570..75589182 100644 --- a/examples/twisted/websocket/pingpong_keepalive/client.py +++ b/examples/twisted/websocket/pingpong_keepalive/client.py @@ -39,7 +39,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) 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], debug=True) diff --git a/examples/twisted/websocket/pingpong_keepalive/server.py b/examples/twisted/websocket/pingpong_keepalive/server.py index ba6144fd..5fb9c62a 100644 --- a/examples/twisted/websocket/pingpong_keepalive/server.py +++ b/examples/twisted/websocket/pingpong_keepalive/server.py @@ -42,7 +42,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) - factory = WebSocketServerFactory("ws://localhost:9000", debug=False, debugCodePaths=True) + factory = WebSocketServerFactory("ws://127.0.0.1:9000", debug=False, debugCodePaths=True) factory.protocol = WebSocketServerProtocol factory.setProtocolOptions(autoPingInterval=1, autoPingTimeout=3, autoPingSize=20) diff --git a/examples/twisted/websocket/reconnecting/client.py b/examples/twisted/websocket/reconnecting/client.py index 316906e5..4114f01e 100644 --- a/examples/twisted/websocket/reconnecting/client.py +++ b/examples/twisted/websocket/reconnecting/client.py @@ -78,7 +78,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) - factory = MyClientFactory("ws://localhost:9000", debug=False) + factory = MyClientFactory("ws://127.0.0.1:9000", debug=False) reactor.connectTCP("127.0.0.1", 9000, factory) reactor.run() diff --git a/examples/twisted/websocket/reconnecting/server.py b/examples/twisted/websocket/reconnecting/server.py index e2ef4dd6..2a785ed2 100644 --- a/examples/twisted/websocket/reconnecting/server.py +++ b/examples/twisted/websocket/reconnecting/server.py @@ -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 reactor.listenTCP(9000, factory) diff --git a/examples/twisted/websocket/slowsquare/client.py b/examples/twisted/websocket/slowsquare/client.py index 0ec4c966..7c6d5ee4 100644 --- a/examples/twisted/websocket/slowsquare/client.py +++ b/examples/twisted/websocket/slowsquare/client.py @@ -59,7 +59,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 = SlowSquareClientProtocol reactor.connectTCP("127.0.0.1", 9000, factory) diff --git a/examples/twisted/websocket/slowsquare/server.py b/examples/twisted/websocket/slowsquare/server.py index c0a4e52f..22fb6f67 100644 --- a/examples/twisted/websocket/slowsquare/server.py +++ b/examples/twisted/websocket/slowsquare/server.py @@ -70,7 +70,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 = SlowSquareServerProtocol reactor.listenTCP(9000, factory) diff --git a/examples/twisted/websocket/streaming/frame_based_client.py b/examples/twisted/websocket/streaming/frame_based_client.py index 5e7496ad..e852c08c 100644 --- a/examples/twisted/websocket/streaming/frame_based_client.py +++ b/examples/twisted/websocket/streaming/frame_based_client.py @@ -84,7 +84,7 @@ class FrameBasedHashClientProtocol(WebSocketClientProtocol): if __name__ == '__main__': - factory = WebSocketClientFactory("ws://localhost:9000") + factory = WebSocketClientFactory("ws://127.0.0.1:9000") factory.protocol = FrameBasedHashClientProtocol enableCompression = False diff --git a/examples/twisted/websocket/streaming/frame_based_server.py b/examples/twisted/websocket/streaming/frame_based_server.py index 6a002c51..24a1330d 100644 --- a/examples/twisted/websocket/streaming/frame_based_server.py +++ b/examples/twisted/websocket/streaming/frame_based_server.py @@ -60,7 +60,7 @@ class FrameBasedHashServerProtocol(WebSocketServerProtocol): if __name__ == '__main__': - factory = WebSocketServerFactory("ws://localhost:9000") + factory = WebSocketServerFactory("ws://127.0.0.1:9000") factory.protocol = FrameBasedHashServerProtocol enableCompression = False diff --git a/examples/twisted/websocket/streaming/message_based_client.py b/examples/twisted/websocket/streaming/message_based_client.py index 9e802339..2c4238b5 100644 --- a/examples/twisted/websocket/streaming/message_based_client.py +++ b/examples/twisted/websocket/streaming/message_based_client.py @@ -59,7 +59,7 @@ class MessageBasedHashClientProtocol(WebSocketClientProtocol): if __name__ == '__main__': - factory = WebSocketClientFactory("ws://localhost:9000") + factory = WebSocketClientFactory("ws://127.0.0.1:9000") factory.protocol = MessageBasedHashClientProtocol connectWS(factory) reactor.run() diff --git a/examples/twisted/websocket/streaming/message_based_server.py b/examples/twisted/websocket/streaming/message_based_server.py index 76d5f061..bc572e11 100644 --- a/examples/twisted/websocket/streaming/message_based_server.py +++ b/examples/twisted/websocket/streaming/message_based_server.py @@ -48,7 +48,7 @@ class MessageBasedHashServerProtocol(WebSocketServerProtocol): if __name__ == '__main__': - factory = WebSocketServerFactory("ws://localhost:9000") + factory = WebSocketServerFactory("ws://127.0.0.1:9000") factory.protocol = MessageBasedHashServerProtocol listenWS(factory) reactor.run() diff --git a/examples/twisted/websocket/streaming/streaming_client.py b/examples/twisted/websocket/streaming/streaming_client.py index 83ddb9e2..02bfb169 100644 --- a/examples/twisted/websocket/streaming/streaming_client.py +++ b/examples/twisted/websocket/streaming/streaming_client.py @@ -67,7 +67,7 @@ class StreamingHashClientProtocol(WebSocketClientProtocol): if __name__ == '__main__': - factory = WebSocketClientFactory("ws://localhost:9000") + factory = WebSocketClientFactory("ws://127.0.0.1:9000") factory.protocol = StreamingHashClientProtocol connectWS(factory) reactor.run() diff --git a/examples/twisted/websocket/streaming/streaming_producer_client.py b/examples/twisted/websocket/streaming/streaming_producer_client.py index fd63cb08..ec386910 100644 --- a/examples/twisted/websocket/streaming/streaming_producer_client.py +++ b/examples/twisted/websocket/streaming/streaming_producer_client.py @@ -95,7 +95,7 @@ class StreamingProducerHashClientProtocol(WebSocketClientProtocol): if __name__ == '__main__': - factory = WebSocketClientFactory("ws://localhost:9000") + factory = WebSocketClientFactory("ws://127.0.0.1:9000") factory.protocol = StreamingProducerHashClientProtocol connectWS(factory) reactor.run() diff --git a/examples/twisted/websocket/streaming/streaming_server.py b/examples/twisted/websocket/streaming/streaming_server.py index edd693eb..e07bbbc8 100644 --- a/examples/twisted/websocket/streaming/streaming_server.py +++ b/examples/twisted/websocket/streaming/streaming_server.py @@ -89,7 +89,7 @@ class StreamingHashServerProtocol(WebSocketServerProtocol): if __name__ == '__main__': - factory = WebSocketServerFactory("ws://localhost:9000") + factory = WebSocketServerFactory("ws://127.0.0.1:9000") factory.protocol = StreamingHashServerProtocol listenWS(factory) reactor.run() diff --git a/examples/twisted/websocket/testee/testee_server.py b/examples/twisted/websocket/testee/testee_server.py index 581e6cf7..24b88f6e 100644 --- a/examples/twisted/websocket/testee/testee_server.py +++ b/examples/twisted/websocket/testee/testee_server.py @@ -113,7 +113,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) - factory = TesteeServerFactory("ws://localhost:9001", debug=False) + factory = TesteeServerFactory("ws://127.0.0.1:9001", debug=False) reactor.listenTCP(9001, factory) reactor.run() diff --git a/examples/twisted/websocket/wrapping/client.py b/examples/twisted/websocket/wrapping/client.py index 58836cd6..a0883ffa 100644 --- a/examples/twisted/websocket/wrapping/client.py +++ b/examples/twisted/websocket/wrapping/client.py @@ -51,7 +51,7 @@ if __name__ == '__main__': wrappedFactory = Factory.forProtocol(HelloClientProtocol) factory = WrappingWebSocketClientFactory(wrappedFactory, - "ws://localhost:9000", + "ws://127.0.0.1:9000", debug=False, enableCompression=False, autoFragmentSize=1024) diff --git a/examples/twisted/websocket/wrapping/client_endpoint.py b/examples/twisted/websocket/wrapping/client_endpoint.py index 14b2d902..66dbc2f8 100644 --- a/examples/twisted/websocket/wrapping/client_endpoint.py +++ b/examples/twisted/websocket/wrapping/client_endpoint.py @@ -50,7 +50,7 @@ if __name__ == '__main__': wrappedFactory = Factory.forProtocol(HelloClientProtocol) - endpoint = clientFromString(reactor, "autobahn:tcp\:localhost\:9000:url=ws\://localhost\:9000") + endpoint = clientFromString(reactor, "autobahn:tcp\:127.0.0.1\:9000:url=ws\://localhost\:9000") endpoint.connect(wrappedFactory) reactor.run() diff --git a/examples/twisted/websocket/wrapping/server.py b/examples/twisted/websocket/wrapping/server.py index ed7000f7..1c6dd741 100644 --- a/examples/twisted/websocket/wrapping/server.py +++ b/examples/twisted/websocket/wrapping/server.py @@ -51,7 +51,7 @@ if __name__ == '__main__': wrappedFactory = Factory.forProtocol(HelloServerProtocol) factory = WrappingWebSocketServerFactory(wrappedFactory, - "ws://localhost:9000", + "ws://127.0.0.1:9000", debug=False, enableCompression=False, autoFragmentSize=1024) diff --git a/examples/twisted/websocket/wrapping/server_endpoint.py b/examples/twisted/websocket/wrapping/server_endpoint.py index 03181ddd..63c0f1af 100644 --- a/examples/twisted/websocket/wrapping/server_endpoint.py +++ b/examples/twisted/websocket/wrapping/server_endpoint.py @@ -50,7 +50,7 @@ if __name__ == '__main__': wrappedFactory = Factory.forProtocol(HelloServerProtocol) - endpoint = serverFromString(reactor, "autobahn:tcp\:9000:url=ws\://localhost\:9000") + endpoint = serverFromString(reactor, "autobahn:tcp\:9000:url=ws\://127.0.0.1\:9000") endpoint.listen(wrappedFactory) reactor.run() diff --git a/examples/twisted/websocket/wxpython/client.py b/examples/twisted/websocket/wxpython/client.py index 0c6a63f2..9705727e 100644 --- a/examples/twisted/websocket/wxpython/client.py +++ b/examples/twisted/websocket/wxpython/client.py @@ -155,7 +155,7 @@ if __name__ == '__main__': app._frame.Show() reactor.registerWxApp(app) - app._factory = MyClientFactory("ws://localhost:9000", app) + app._factory = MyClientFactory("ws://127.0.0.1:9000", app) reactor.connectTCP("127.0.0.1", 9000, app._factory) diff --git a/examples/twisted/websocket/wxpython/server.py b/examples/twisted/websocket/wxpython/server.py index e120e3e8..25219304 100644 --- a/examples/twisted/websocket/wxpython/server.py +++ b/examples/twisted/websocket/wxpython/server.py @@ -77,7 +77,7 @@ if __name__ == '__main__': log.startLogging(sys.stdout) - factory = BroadcastServerFactory("ws://localhost:9000") + factory = BroadcastServerFactory("ws://127.0.0.1:9000") reactor.listenTCP(9000, factory) reactor.run()