https://github.com/sjkingo/websocket-chat
A proof-of-concept chat server/client in WebSockets
https://github.com/sjkingo/websocket-chat
asyncio javascript python python-3 websocket-chat websockets
Last synced: 9 months ago
JSON representation
A proof-of-concept chat server/client in WebSockets
- Host: GitHub
- URL: https://github.com/sjkingo/websocket-chat
- Owner: sjkingo
- Created: 2015-01-12T12:59:30.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-12T17:59:20.000Z (over 11 years ago)
- Last Synced: 2024-12-20T13:32:40.582Z (over 1 year ago)
- Topics: asyncio, javascript, python, python-3, websocket-chat, websockets
- Language: Python
- Size: 113 KB
- Stars: 17
- Watchers: 3
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
websocket-chat
==============
A Websockets IRC-style chat server and client. It is written purely as a demo
of Websockets functionality and probably servces no useful purpose!
The server is written in Python 3 using `asyncio` and the `websockets` library.
The client is written in HTML5 and uses Bootstrap 3.
If you are using a Python version below 3.4, you will need to manually install
the `asyncio` library as it is not included.
### To start the server:
1. Install dependencies for the server (preferably in a virtualenv):
```
$ pip install -r server/requirements.txt
```
2. Run the server on port 8080:
```
$ python3 server/run.py
````
By default the server listens on `0.0.0.0:8080`. If this is not desired, edit `server/run.py:LISTEN_ADDRESS` and `html5client/ws.js:server`.
### To load the client:
1. Fire up the built-in Python web server and load the client from there:
```
$ cd html5client
$ python3 -m http.server
$ $BROWSER 'http://localhost:8000/'
```