https://github.com/docelic/zeromq-group-chat
Simplest working ZeroMQ-based group chat
https://github.com/docelic/zeromq-group-chat
Last synced: 2 months ago
JSON representation
Simplest working ZeroMQ-based group chat
- Host: GitHub
- URL: https://github.com/docelic/zeromq-group-chat
- Owner: docelic
- Created: 2022-01-09T16:36:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T16:47:25.000Z (over 3 years ago)
- Last Synced: 2025-02-05T21:33:25.622Z (4 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zeromq-group-chat
Simplest possible group chat implemented using ZeroMQ.
Uses a central server to which all users connect.
Implements chat using 2 ZeroMQ sockets:
- One REQ-REP for submitting new messages to the server
- One PUB-SUB for distributing messages from the server to all connected clients## Client
```
python3 client.py [nickname] [host] [send_port] [recv_port]
```For messages from local user the client simply reads lines from
the terminal in the usual cooked mode. Readline or similar
library is not used, but you can run the application under
`rlwrap` to enable readline functionality.## Server
```
python3 server.py [SEND_PORT] [RECV_PORT] [HOST]
```The server simply waits for incoming messages and publishes
them to all connected subscribers / clients.## ZeroMQ Details
The app uses a REQ-REP and a PUB-SUB socket.
Alternatively, submitting messages to the server could be
implemented using REQ or DEALER requests to the server's
ROUTER socket.## Encryption
Encryption is not included. One could e.g. set up a double
ratchet encryption with https://github.com/tgalal/python-axolotl.