https://github.com/stark-x/websocketchatroom
Training for websocket
https://github.com/stark-x/websocketchatroom
learning python training websocket
Last synced: 12 months ago
JSON representation
Training for websocket
- Host: GitHub
- URL: https://github.com/stark-x/websocketchatroom
- Owner: Stark-X
- Created: 2018-03-13T09:18:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T16:25:01.000Z (about 8 years ago)
- Last Synced: 2025-03-26T15:26:24.807Z (over 1 year ago)
- Topics: learning, python, training, websocket
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebSocketChatroom
This project is set up for practicing the websocket with `Tornado`.
Everyone could easily join the chatroom on bowser or other clients.
## Prerequisistes
- Python3
- [pipenv](https://github.com/pypa/pipenv)
## Usage
1. Install dependencis by `pipenv`
```
pipenv install
```
2. Start the server in the virtualenv
```
pipenv run python server.py
```
3. Use JavaScript on browser to verify
Open the browser DEV tools, use the console on it to enter below command.
```
var ws = new WebSocket("ws://localhost:8080")
ws.onmessage = evt => {console.log(evt.data)}
ws.send('{"name": "abc", "action": "add"}')
ws.send('{"action": "say", "message": "Hello world!"}')
ws.send('{"action": "close"}')
```
## Configuration
- logger settings in `config/logger.ini`