diff --git a/README.md b/README.md index d61f3a8..65a4f61 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# fastapi-socketio +# This is forked version of fastapi-socketio + +For original repo visit: https://github.com/pyropy/fastapi-socketio [![PyPI](https://img.shields.io/pypi/v/fastapi-socketio.svg)](https://pypi.org/project/fastapi-socketio/) [![Changelog](https://img.shields.io/github/v/release/pyropy/fastapi-socketio?label=changelog)](https://github.com/pyropy/fastapi-socketio/releases) @@ -78,8 +80,14 @@ To run the examples simply run: PYTHONPATH=. python examples/app.py ``` +Sample socketio client run: + +```bash +PYTHONPATH=. python examples/client.py +``` + Before running example make sure you have all dependencies installed. ## Contributors -For list of contributors please reefer to CONTRIBUTORS.md file in this repository. \ No newline at end of file +For list of contributors please refer to CONTRIBUTORS.md file in this repository. diff --git a/examples/client.py b/examples/client.py new file mode 100644 index 0000000..236691c --- /dev/null +++ b/examples/client.py @@ -0,0 +1,15 @@ +import socketio + +sio = socketio.Client() + +@sio.event +def connect(): + print("Connected!") + +@sio.on('test') +def on_message(data): + print('Message Received!') + print(data) + +sio.connect('http://127.0.0.1:8000/ws', socketio_path="/ws/socket.io", wait_timeout = 10) +sio.wait()