3 Protocol
rafi612 edited this page 2025-10-06 17:51:29 +00:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

WTP Protocol Documentation

1. Overview

WTP - Wpkg Transmission Protocol

A lightweight, TCP-based protocol designed for communication between neo-rs and wpkg-studio.


2. Protocol

  • Protocol type: TCP
  • Default ports: 5000
  • Security: TLS

3. Payload structure

3.1 Payload types

  • Message
  • Action
  • Binary
  • Ping

3.2 General structure

Every payload consists of two parts:

  1. Header always ends with \n (newline separator)
  2. Payload data body, depends on payload type
<payload_identifier> <header_data>\n
<payload_data>

3.3 General fields

Field Type Description Example values
payload_identifier string Identifier of the payload type m, a, b, s, p
header_data string Header data used to decode payload_data (depends on type) Message: (length)
Action: (action_name)
payload_data object Data specific to the payload (varies by type)

4. Payload Types and Responses

4.1 Message

Purpose: Exchange of text messages between neo-rs and wpkg-studio.

Format:

m <message_length>\n
<message>

Fields:

Field Type Description Example value
m string Identifier of the payload type m
message_length int Length of the message in bytes/chars 65536
message object Actual message content (varies)

WTP Protocol Documentation

4. Payload Types and Responses

4.2 Action

Purpose: Exchange of management commands between neo-rs and server.

Request Format:

a <action_name>\n
parameter: value\n
parameter2: value2
\n\n

Response Format:

a <action_name> <error_code> <message_length>\n
<message>

Fields:

Field Type Description Example value
action_name string Name of the action executed by the server init-rat
error_code int Status/error code returned by the server 0
message_length int Length of the following message in bytes 42
message string Textual message or payload returned Initialization successful

4.3 Binary

Purpose: Exchange of binary data between neo-rs and wpkg-studio, used for sending files.

Format:

b <binary_length>\n
<bytes>

Fields:

Field Type Description Example value
b string Identifier of the payload type b
binary_length int Length of binary payload 65536
bytes byte Binary data (binary data)

4.4 Ping

Purpose: Keep-alive mechanism.

Format:

p\n

Fields:

Field Type Description Example value
p string Identifier of the payload type p