KeepAliveRequestProtocol
A mix-in protocol between http and websocket. It combines the route-based navigation of http with the streamed aspects of websockets.
This is still an early stage of development, things can change heavily in the future.
Requirements
Python3.6+
Installation
Pip:
pip install karp
From Source:
git clone --depth=1 https://github.com/tooxo/karp
cd karp/
pip install .
Protocol Definition
Request
| name | content | length |
|---|---|---|
| Header Text | KARP_HEAD |
9 |
| Route (case insensitive) | route name ([A-z_]) | n/a |
| Type (Request=0; Response=1) | 0 | 1 |
| Response Wanted (0 or 1) | 1 | 1 |
| Request ID | Request Identifier (16* [0-9]) | 16 |
| Content_Length | C_LEN |
5 |
| Content_Length | content length in num of bytes | n/a |
| Data | KARP_DATA |
9 |
| Data | request data encoded in base64 | Content_Length |
| End of Request | KARP_END |
7 |
Length = 9 + len(route_name) + 1 + 1 + 16 + 5 + len(content_length) + 9 + content_length +
Meta
- Allowed chars:
[A-Za-z0-9+/=]
Response
| name | content | length |
|---|---|---|
| Header Text | KARP_HEAD |
9 |
| Type (Request=0; Response=1) | 1 | 1 |
| Request Successful (1/0)*¹ | 1 | 1 |
| Request ID | Request Identifier (16* [0-9]) | 16 |
| Content_Length | C_LEN |
5 |
| Content_Length | content length in num of bytes | n/a |
| Data | KARP_DATA |
9 |
| Data | request data encoded in base64 | Content_Length |
| End of Request | KARP_END |
7 |
*¹ = If the request was not successful, the data will be an error message.
Meta
- Allowed chars: [A-Za-z0-9+/=]
- Every Response/Request sent to the socket ends with
\nas a command-separator.
TODO:
- Add Getting Started to README
- Unit-Tests
Release files for karp 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| karp-0.0.14.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| karp-0.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.2 kB
Release files / karp-0.0.14.tar.gz
| Download URL | karp-0.0.14.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd8eb0ff9940d540d597203b960af9bf58f59908db13855ffbaa2b19b986a44b
|
|
BLAKE2b-256 checksum How to use checksums |
401db25568084d6464d939c640d659ccc265b89f5312e6f72bffd196317e90e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|
Release files / karp-0.0.14-py3-none-any.whl
| Download URL | karp-0.0.14-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f65c019985fb1b35f23eeda856aff44667926a9eaa1db392eb3abad4d8352134
|
|
BLAKE2b-256 checksum How to use checksums |
c8e5901a90f67a5f77830f01fd0484701aa570fc86be6ae02dd40e467053e004
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
|