Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1.15 KB

README.md

File metadata and controls

33 lines (20 loc) · 1.15 KB

Proxy Transport

Proxy Transport is a TCP transport protocol implementation to replace the inefficient RakNet protocol implementation between proxies and downstream servers.

From the internal documentation:

Format

Packet frames have the following format:

  • frameLength: int
  • leadingByte: byte (compression indicator. 0 is Zlib, 1 is ZSTD)
  • buffer: ByteBuf (the packets are formatted in the MCPE batch packet format)

Dynamic Compression

The leadingByte (internally referred to as compressionType) gives us the ability to use faster compression methods than zlib if possible.

When Zstd is being used:

A client-sent packet has been altered by the rewrite protocol and the entire buffer has to be re-compressed. Since Zstd has faster compression types, we use it here.

When Zlib is being used:

A client-sent packet has not been altered, the original buffer is directly relayed to the downstream server to save us the compression.

The downstream-server sends to the client. We use zlib so that we can send the initial buffer directly in case we do not modify the packets.