Chat Server
A simple chat server written in python.
Features
The features of chatserver include:
- Optional TLS
- User accounts
- Chat Rooms
TLS Certificates
Setup is only currently required if you want to use tls. To do this you need to generate a crt and key file.
mkdir certs
cd certs
openssl req -newkey rsa:2048 -nodes -keyout chatserv.key -x509 -days 365 -out chatserv.crt
Running The Server
Pip
You can install chatserver using pip.
pip install --upgrade chatserver
chatserver
Build Locally
Make sure poetry is installed and up to date.
pip install --upgrade poetry
Install all the dependencies
poetry install
You can now run the project from outside poetry's virtual env
poetry run chatserver
Or from within it
chatserver
If you want to use TLS you need to set environment variables:
CERT_FILEKEY_FILEPORT
With Docker
You can either build locally or use the image from the registry
# Build locally
docker build -t chatserver .
docker run --name chatserver_name -p 7878:7878 chatserver
# Using the image from the registry
docker build -t chatserver .
docker run --name chatserver_name -p 7878:7878 registry.gitlab.com/mokytis/python-chatserver:latest
To use tls you will need to mount a direcory containg the crt and key files and set enviornment variables.
Example:
docker run -i -t -d \
-p 7878:7878 \
-v /path/to/certs/directory:/certs \
-e CERT_FILE='/certs/chatserv.crt' \
-e KEY_FILE='/certs/chatserv.key' \
--name chatserver
chatserver
Connecting To The Server
No TLS
If the server is not using tls you can connect to the server using any TCP client.
nc localhost 7878
TLS
If the server is using TLS you can connect using openssl
openssl s_client -connect localhost:7878
Metadata
Release files for chatserver 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chatserver-0.1.5.tar.gz | 6.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatserver-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / chatserver-0.1.5.tar.gz
| Download URL | chatserver-0.1.5.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e396b698b5d8d50e607306601c6dac0e63bd121e403cb847031ed2182d529fc
|
|
BLAKE2b-256 checksum How to use checksums |
aad2bdb97f1fa42fc21f28388d1a7fc5e4c9686a071df006cc201622484ed333
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.3 CPython/3.8.0 Linux/5.0.0-38-generic
|
Release files / chatserver-0.1.5-py3-none-any.whl
| Download URL | chatserver-0.1.5-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc74a8bde101d4fe181884201003864d9975390244ae2b59bdc7bae000851b47
|
|
BLAKE2b-256 checksum How to use checksums |
9180e6d9e3acc7a6ce3a78514ed9019ca908bc4a21e2cdc35b45e8b52fbd3934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.3 CPython/3.8.0 Linux/5.0.0-38-generic
|
Security for chatserver 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.