File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ The API is simply methods and properties of the `WebsocketServer` class.
4141
4242The WebsocketServer takes two arguments: a ` port ` and a ` hostname ` .
4343By default ` localhost ` is used. However if you want to be able and connect
44- to the server from the network you need to pass ` 0.0.0.0 ` as hostname.
44+ to the server from the network you need to pass ` 0.0.0.0 ` as hostname. e.g., WebsocketServer(13254, '127.0.0.2') for custom IP.
4545
4646###Properties
4747
@@ -81,7 +81,7 @@ from websocket_server import WebsocketServer
8181def new_client(client, server):
8282 server.send_message_to_all("Hey all, a new client has joined us")
8383
84- server = WebsocketServer(13254)
84+ server = WebsocketServer(13254, host='127.0.0.1' )
8585server.set_fn_new_client(new_client)
8686server.run_forever()
8787````
You can’t perform that action at this time.
0 commit comments