Giter Club home page Giter Club logo

proxytransport's Introduction

Proxy Transport

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

Format

Packet frames have the following format:

  • frameLength: int
  • buffer: ByteBuf (the packets are formatted in the MCPE batch packet format with compression type byte in front of it)

Compression

ProxyTransport leverages different compression algorithms to improve bandwidth usage and CPU Usage. Three compression algorithms are supported: Zlib, Snappy, and Zstd.

The compression byte has been extended with type 254 to support ZSTD as compression algorithm.

General rule

Packets are bi-directional. A packet can be sent from the client (or proxy) to the downstream server (Serverbound) or from the downstream server to the client (Clientbound).

Since the 1.19.30 update, the client can use both the Zlib and the Snappy compression, the proxy can dictate which one to use. For clients < 1.19.30, zlib is the only option.

The following rules apply:

  • Serverbound:
    • Unrewritten packet batches are unchanged. They use the compression that the proxy dictated to the client and may be recompressed if the compressions differ.
    • Rewritten packet batches are re-compressed using Zstd.
  • Clientbound:
    • Packets have to be sent in the compression of the client from the downstream server, otherwise every packet batch will have to be recompressed. That is possible, however not desired since it will cause notable overhead.

The proxy receives and matches the NetworkSettingsPacket from the Downstream server to decide whether recompression is necessary.

For every session two values are maintained: the clientNativeCompressionAlgo and the serverNativeCompressionAlgo.

The clientNative algorithm is the algorithm that the client uses to send packets to the server. The server native algorithm is what the server uses to send to the client.

proxytransport's People

Contributors

dries-c avatar flonja avatar larrythecoder avatar tobiasgrether avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

proxytransport's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.