Multi-language server with HTTP 3.0 and WebTransport support.
Project description
🚀 About
Arnelify® Server for Rust — a multi-language server with HTTP 3.0 and WebTransport support.
All supported protocols:
| # | Protocol | Transport |
|---|---|---|
| 1 | TCP1 | HTTP 1.1 |
| 2 | TCP1 | HTTP 2.0 |
| 3 | TCP1 | WebSocket |
| 4 | TCP2 | HTTP 3.0 |
| 5 | TCP2 | WebTransport |
📋 Minimal Requirements
Important: It's strongly recommended to use in a container that has been built from the gcc v15.2.0 image.
- CPU: Apple M1 / Intel Core i7 / AMD Ryzen 7
- OS: Debian 11 / MacOS 15 / Windows 10 with WSL2.
- RAM: 4 GB
📦 Installation
Run in terminal:
pip install arnelify_server
🎉 TCP2 / WebTransport
📚 Configuration
| Option | Description |
|---|---|
| BLOCK_SIZE_KB | The size of the allocated memory used for processing large packets. |
| CERT_PEM | Path to the TLS cert-file in PEM format. |
| COMPRESSION | If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of BLOCK_SIZE_KB. |
| HANDSHAKE_TIMEOUT | Maximum time in seconds to complete the TLS handshake. |
| KEY_PEM | Path to the TLS private key-file in PEM format. |
| MAX_MESSAGE_SIZE_MB | Maximum size of a single message the server will accept from a client. |
| PING_TIMEOUT | Maximum time the server will wait for a ping from the client. |
| PORT | Defines which port the server will listen on. |
| SEND_TIMEOUT | Maximum time for the client to receive a response from the server. |
| THREAD_LIMIT | Defines the maximum number of threads that will handle requests. |
📚 Examples
from arnelify_server import WebTransport
from arnelify_server import WebTransportBytes
from arnelify_server import WebTransportCtx
from arnelify_server import WebTransportOpts
from arnelify_server import WebTransportStream
import asyncio
from typing import Awaitable
async def main() -> Awaitable[None]:
wt_opts: WebTransportOpts = {
"block_size_kb": 64,
"cert_pem": "certs/cert.pem",
"compression": True,
"handshake_timeout": 30,
"key_pem": "certs/key.pem",
"max_message_size_kb": 64,
"ping_timeout": 15,
"port": 4433,
"send_timeout": 30,
"thread_limit": 4
}
wt: WebTransport = WebTransport(wt_opts)
async def wt_logger(_level: str, message: str) -> Awaitable[None]:
print("[Arnelify Server]: " + message)
wt.logger(wt_logger)
async def wt_handler(ctx: WebTransportCtx, bytes: WebTransportBytes, stream: WebTransportStream) -> Awaitable[None]:
await stream.push(ctx, bytes)
await stream.close()
wt.on("connect", wt_handler)
await wt.start()
if __name__ == "__main__":
asyncio.run(main())
🎉 TCP2 / HTTP 3.0
📚 Configuration
| Option | Description |
|---|---|
| ALLOW_EMPTY_FILES | If this option is enabled, the server will not reject empty files. |
| BLOCK_SIZE_KB | The size of the allocated memory used for processing large packets. |
| CERT_PEM | Path to the TLS cert-file in PEM format. |
| CHARSET | Defines the encoding that the server will recommend to all client applications. |
| COMPRESSION | If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of BLOCK_SIZE_KB. |
| KEEP_EXTENSIONS | If this option is enabled, file extensions will be preserved. |
| KEY_PEM | Path to the TLS private key-file in PEM format. |
| MAX_FIELDS | Defines the maximum number of fields in the received form. |
| MAX_FIELDS_SIZE_TOTAL_MB | Defines the maximum total size of all fields in the form. This option does not include file sizes. |
| MAX_FILES | Defines the maximum number of files in the form. |
| MAX_FILES_SIZE_TOTAL_MB | Defines the maximum total size of all files in the form. |
| MAX_FILE_SIZE_MB | Defines the maximum size of a single file in the form. |
| PORT | Defines which port the server will listen on. |
| STORAGE_PATH | Specifies the upload directory for storage. |
| THREAD_LIMIT | Defines the maximum number of threads that will handle requests. |
📚 Examples
from arnelify_server import Http3
from arnelify_server import Http3Ctx
from arnelify_server import Http3Opts
from arnelify_server import Http3Stream
import asyncio
from typing import Awaitable
async def main() -> Awaitable[None]:
http3_opts: Http3Opts = {
"allow_empty_files": True,
"block_size_kb": 64,
"cert_pem": "certs/cert.pem",
"charset": "utf-8",
"compression": True,
"keep_alive": 30,
"keep_extensions": True,
"key_pem": "certs/key.pem",
"max_fields": 60,
"max_fields_size_total_mb": 1,
"max_files": 3,
"max_files_size_total_mb": 60,
"max_file_size_mb": 60,
"port": 4433,
"storage_path": "/var/www/cpp/storage",
"thread_limit": 4,
}
http3: Http3 = Http3(http3_opts)
async def http3_logger(_level: str, message: str) -> Awaitable[None]:
print("[Arnelify Server]: " + message)
http3.logger(http3_logger)
async def http3_handler(ctx: Http3Ctx, stream: Http3Stream) -> Awaitable[None]:
await stream.set_code(200)
await stream.push_json(ctx)
await stream.end()
http3.on("/", http3_handler)
await http3.start()
if __name__ == "__main__":
asyncio.run(main())
🎉 TCP1 / WebSocket
📚 Configuration
| Option | Description |
|---|---|
| BLOCK_SIZE_KB | The size of the allocated memory used for processing large packets. |
| COMPRESSION | If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of BLOCK_SIZE_KB. |
| HANDSHAKE_TIMEOUT | Maximum time in seconds to complete the TLS handshake. |
| MAX_MESSAGE_SIZE_MB | Maximum size of a single message the server will accept from a client. |
| PING_TIMEOUT | Maximum time the server will wait for a ping from the client. |
| PORT | Defines which port the server will listen on. |
| SEND_TIMEOUT | Maximum time for the client to receive a response from the server. |
| THREAD_LIMIT | Defines the maximum number of threads that will handle requests. |
📚 Examples
from arnelify_server import WebSocket
from arnelify_server import WebSocketBytes
from arnelify_server import WebSocketCtx
from arnelify_server import WebSocketOpts
from arnelify_server import WebSocketStream
import asyncio
from typing import Awaitable
async def main() -> Awaitable[None]:
ws_opts: WebSocketOpts = {
"block_size_kb": 64,
"compression": True,
"handshake_timeout": 30,
"max_message_size_kb": 64,
"ping_timeout": 15,
"port": 4433,
"send_timeout": 30,
"thread_limit": 4
}
ws: WebSocket = WebSocket(ws_opts)
async def ws_logger(_level: str, message: str) -> Awaitable[None]:
print("[Arnelify Server]: " + message)
ws.logger(ws_logger)
async def ws_handler(ctx: WebSocketCtx, bytes: WebSocketBytes, stream: WebSocketStream) -> Awaitable[None]:
await stream.push(ctx, bytes)
await stream.close()
ws.on("connect", ws_handler)
await ws.start()
if __name__ == "__main__":
asyncio.run(main())
🎉 TCP1 / HTTP 2.0
📚 Configuration
| Option | Description |
|---|---|
| ALLOW_EMPTY_FILES | If this option is enabled, the server will not reject empty files. |
| BLOCK_SIZE_KB | The size of the allocated memory used for processing large packets. |
| CERT_PEM | Path to the TLS cert-file in PEM format. |
| CHARSET | Defines the encoding that the server will recommend to all client applications. |
| COMPRESSION | If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of BLOCK_SIZE_KB. |
| KEEP_EXTENSIONS | If this option is enabled, file extensions will be preserved. |
| KEY_PEM | Path to the TLS private key-file in PEM format. |
| MAX_FIELDS | Defines the maximum number of fields in the received form. |
| MAX_FIELDS_SIZE_TOTAL_MB | Defines the maximum total size of all fields in the form. This option does not include file sizes. |
| MAX_FILES | Defines the maximum number of files in the form. |
| MAX_FILES_SIZE_TOTAL_MB | Defines the maximum total size of all files in the form. |
| MAX_FILE_SIZE_MB | Defines the maximum size of a single file in the form. |
| PORT | Defines which port the server will listen on. |
| STORAGE_PATH | Specifies the upload directory for storage. |
| THREAD_LIMIT | Defines the maximum number of threads that will handle requests. |
📚 Examples
from arnelify_server import Http2
from arnelify_server import Http2Ctx
from arnelify_server import Http2Opts
from arnelify_server import Http2Stream
import asyncio
from typing import Awaitable
async def main() -> Awaitable[None]:
http2_opts: Http2Opts = {
"allow_empty_files": True,
"block_size_kb": 64,
"cert_pem": "certs/cert.pem",
"charset": "utf-8",
"compression": True,
"keep_alive": 30,
"keep_extensions": True,
"key_pem": "certs/key.pem",
"max_fields": 60,
"max_fields_size_total_mb": 1,
"max_files": 3,
"max_files_size_total_mb": 60,
"max_file_size_mb": 60,
"port": 4433,
"storage_path": "/var/www/cpp/storage",
"thread_limit": 4,
}
http2: Http2 = Http2(http2_opts)
async def http2_logger(_level: str, message: str) -> Awaitable[None]:
print("[Arnelify Server]: " + message)
http2.logger(http2_logger)
async def http2_handler(ctx: Http2Ctx, stream: Http2Stream) -> Awaitable[None]:
await stream.set_code(200)
await stream.push_json(ctx)
await stream.end()
http2.on("/", http2_handler)
await http2.start()
if __name__ == "__main__":
asyncio.run(main())
🎉 TCP1 / HTTP 1.1
📚 Configuration
| Option | Description |
|---|---|
| ALLOW_EMPTY_FILES | If this option is enabled, the server will not reject empty files. |
| BLOCK_SIZE_KB | The size of the allocated memory used for processing large packets. |
| CHARSET | Defines the encoding that the server will recommend to all client applications. |
| COMPRESSION | If this option is enabled, the server will use BROTLI compression if the client application supports it. This setting increases CPU resource consumption. The server will not use compression if the data size exceeds the value of BLOCK_SIZE_KB. |
| KEEP_EXTENSIONS | If this option is enabled, file extensions will be preserved. |
| MAX_FIELDS | Defines the maximum number of fields in the received form. |
| MAX_FIELDS_SIZE_TOTAL_MB | Defines the maximum total size of all fields in the form. This option does not include file sizes. |
| MAX_FILES | Defines the maximum number of files in the form. |
| MAX_FILES_SIZE_TOTAL_MB | Defines the maximum total size of all files in the form. |
| MAX_FILE_SIZE_MB | Defines the maximum size of a single file in the form. |
| PORT | Defines which port the server will listen on. |
| STORAGE_PATH | Specifies the upload directory for storage. |
| THREAD_LIMIT | Defines the maximum number of threads that will handle requests. |
📚 Examples
from arnelify_server import Http1
from arnelify_server import Http1Ctx
from arnelify_server import Http1Opts
from arnelify_server import Http1Stream
import asyncio
from typing import Awaitable
async def main() -> Awaitable[None]:
http1_opts: Http1Opts = {
"allow_empty_files": True,
"block_size_kb": 64,
"charset": "utf-8",
"compression": True,
"keep_alive": 30,
"keep_extensions": True,
"max_fields": 60,
"max_fields_size_total_mb": 1,
"max_files": 3,
"max_files_size_total_mb": 60,
"max_file_size_mb": 60,
"port": 4433,
"storage_path": "/var/www/cpp/storage",
"thread_limit": 4,
}
http1: Http1 = Http1(http1_opts)
async def http1_logger(_level: str, message: str) -> Awaitable[None]:
print("[Arnelify Server]: " + message)
http1.logger(http1_logger)
async def http1_handler(ctx: Http1Ctx, stream: Http1Stream) -> Awaitable[None]:
await stream.set_code(200)
await stream.push_json(ctx)
await stream.end()
http1.on("/", http1_handler)
await http1.start()
if __name__ == "__main__":
asyncio.run(main())
⚖️ MIT License
This software is licensed under the MIT License. The original author's name, logo, and the original name of the software must be included in all copies or substantial portions of the software.
🛠️ Contributing
Join us to help improve this software, fix bugs or implement new functionality. Active participation will help keep the software up-to-date, reliable, and aligned with the needs of its users.
Run in terminal:
docker compose up -d --build
docker ps
docker exec -it <CONTAINER ID> bash
make install
source venv/bin/activate
make build
For TCP2 / WebTransport:
make test_wt
For TCP2 / HTTP 3.0:
make test_http3
For TCP1 / WebSocket:
make test_ws
For TCP1 / HTTP 2.0:
make test_http2
For TCP1 / HTTP 1.1:
make test_http1
⭐ Release Notes
Version 0.9.6 — a multi-language server with HTTP 3.0 and WebTransport support.
We are excited to introduce the Arnelify Server for Python! Please note that this version is raw and still in active development.
Change log:
- Async Multi-Threading.
- Block processing in "on-the-fly" mode.
- BROTLI compression (still in development).
- FFI, PYO3 and NEON support.
- Significant refactoring and optimizations.
Please use this version with caution, as it may contain bugs and unfinished features. We are actively working on improving and expanding the server's capabilities, and we welcome your feedback and suggestions.
🔗 Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arnelify_server-0.9.6-cp313-cp313-manylinux_2_38_x86_64.whl.
File metadata
- Download URL: arnelify_server-0.9.6-cp313-cp313-manylinux_2_38_x86_64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.13, manylinux: glibc 2.38+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a063454b3b7967e27c4a7126dab9f18b7690141224e256c59b8de983759715
|
|
| MD5 |
542ea414d1812ddf9cdcb315dbbeeea9
|
|
| BLAKE2b-256 |
3ac7ebe0166b54561b4517dc050bdc73aeb6ca2b204a8001fae0cf4f81c80dc2
|