EasyGameChat
EasyGameChat is a minimal, secure, and cross-platform chat server and client library designed for real-time communication in games or applications. It aims to provide simple, fast integration across multiple languages with a JSON-based protocol and message validation system.
Features
- Lightweight and efficient server implementation in Go
- TLS encryption for secure communication
- Secure and strict input validation
- Modular server-client architecture
- Cross-language support (C++, Python, and more to come)
- JSON-based protocol for easy parsing
- Thread-safe and rate-limited message broadcasting
Getting Started
Server (Go)
- Install Go 1.18 or later.
- Generate a TLS certificte and key with the provided scripts or, preferably, use your own. The server requires a valid certificate and key for secure communication.
- Run the server:
go run main.go
TLS is enabled by default. You can configure certificate paths or disable TLS in the config file or server options.
Client (C++)
- Include
EasyGameChat.hin your project. - Install the required dependencies (only
nlohmann/jsonfor JSON parsing and a TLS library like OpenSSL) with your preferred package manager. On Windows, you can specify your preferred toolchain in the CMake build command with-DCMAKE_TOOLCHAIN_FILE=path/to/your/toolchain.cmake. - Compile and run the example:
cd examples/c-cpp
cmake -B build -S .
# If using vcpkg, specify the toolchain file:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\path\to\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake --build build
./build/chat-client
Run the
/infocommand in the client to display connection details including TLS status.
Client (Python)
cd clients/python
python -m build
python -m pip install .\dist\easy_game_chat-0.3.0-py3-none-any.whl
# or install directly from the source
pip install .
python examples/python/main.py
Token Generation
To generate a token for authentication, use the following command:
go run main.go generate-token <username>
This will generate a token and store its hashed value securely in a tokens.json file. The token is valid for 24 hours and can be used for client authentication. Remember to save the token, as it will not be displayed again.
Protocol
Messages follow a simple JSON format:
{
"from": "nickname",
"text": "message content"
}
All input is sanitized and validated server-side to prevent injection, malformed data, or abuse.
License
This project is licensed under the MIT License.
Metadata
Release files for easygamechat 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| easygamechat-0.3.0.tar.gz | 9.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| easygamechat-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.6 kB
Release files / easygamechat-0.3.0.tar.gz
| Download URL | easygamechat-0.3.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35153ed66b2dcde879fe62994c725726c494a06f04c3035adb329a8dc3f64ff7
|
|
BLAKE2b-256 checksum How to use checksums |
01631e7224419fda579d9e94c56940bc9e7d568b33d27065f7d79a509424d852
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / easygamechat-0.3.0-py3-none-any.whl
| Download URL | easygamechat-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35fdeaec1cd84328b07b981fdfa9d1c4b06fa66d5996760a32090f079a67446d
|
|
BLAKE2b-256 checksum How to use checksums |
f9e00b6abef348df3ce5cabd2e1a29734bad5cdf3c8fc9b1036984fd497e093e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|