Skip to main content

KARP Communication Protocol

Project description

KeepAliveRequestProtocol

PiPy Code style: black

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 \n as a command-separator.

TODO:

  • [ ] Add Getting Started to README
  • [ ] Unit-Tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for karp, version 0.0.13
Filename, size File type Python version Upload date Hashes
Filename, size karp-0.0.13-py3-none-any.whl (8.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size karp-0.0.13.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page