Skip to content

Commit 1fbb59b

Browse files
author
aeroaks
committed
Added example for server IP
1 parent 4dae1c1 commit 1fbb59b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The API is simply methods and properties of the `WebsocketServer` class.
4141

4242
The WebsocketServer takes two arguments: a `port` and a `hostname`.
4343
By 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
8181
def 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')
8585
server.set_fn_new_client(new_client)
8686
server.run_forever()
8787
````

0 commit comments

Comments
 (0)