Deepslate

Introducing Deepslate

Deepslate is a new solution for Minecraft server proxies, written in Rust, with a focus on performance and a compile-time plugin system.

Deepslate supports Minecraft Java Edition 1.21.x and handles authentication, packet forwarding, server switching, and more.

In this inaugural announcement post, I'm going to outline how Deepslate works, who it's designed for, its goals and non-goals, and finally a rundown of how you can get started using it today!

What is a "Minecraft server proxy?"

Before we can even talk about Deepslate, it's important to clarify the role a "Minecraft server proxy" fulfils.

A large Minecraft server network, which presents itself as a single "server," will typically run multiple "backend servers" (e.g. a lobby, a survival world, some minigame servers). Players shouldn't need to disconnect and reconnect with a different address to move between them.

A proxy sits in front of all of these backends, presenting a single address to players. When someone connects, the proxy authenticates them, picks a backend to route them to (e.g. initially the lobby), and then relays packets back and forth. As far as the player is concerned, they've just joined the lobby directly, and no proxy was ever involved!

Then, when a player types /server survival, the proxy quietly disconnects them from one backend server and connects them to another, without the player ever leaving (or knowing that their packets are now being routed somewhere else).

BungeeCord was the original solution to this problem and has been around for over a decade. Waterfall, created by the PaperMC team forked BungeeCord to improve stability and performance, but was eventually discontinued in favour of Velocity. Velocity is now the standard recommendation in the Java ecosystem, with better defaults, a cleaner plugin API, and modern forwarding support.

Why Rust?

So why write another one, and why in Rust?

The proxy is the single process that every player connection touches. If it's slow, everything downstream feels slow. If it crashes, every player on the network disconnects.

Java proxies do this job well (this is not a "Java sucks" post), but they inherit the tradeoffs of the JVM:

For most networks these are non-issues. But for operators who've already optimised everything else and are looking at the proxy as the next bottleneck, a systems language is appealing.

Rust gives us manual memory management without a garbage collector, zero-cost abstractions, and a compiler that catches entire categories of concurrency bugs at build time.

The resulting binary is a single executable with no runtime or framework dependencies, starts accepting connections before you can blink, and has a predictable memory footprint.

That said, Rust comes with its own tradeoffs. The ecosystem for Minecraft tooling is tiny compared to Java's (we are talking about Minecraft Java Edition, after all). The learning curve is steeper.

Deepslate is built for operators who are willing to accept these downsides in exchange for the performance characteristics that Rust provides.

How it works

Deepslate sits between Minecraft clients and your backend servers. It handles the full Minecraft login sequence (encryption, Mojang session authentication, compression) and then connects the player to a backend server using Velocity's modern forwarding protocol, which securely passes the player's identity via an HMAC-SHA256 signed payload. From there, the proxy relays packets bidirectionally between client and backend.

Players can switch servers at runtime via /server command, and the proxy handles the backend transition transparently.

Backend servers don't have to be static either. Deepslate exposes a gRPC control plane that lets you register and deregister servers at runtime, as well as update the try-order (the list of servers that new players are routed through). Your orchestration layer can add and remove backends without restarting or dropping in connections.

The plugin system

Most proxy plugin systems work by loading JAR files or shared libraries at runtime. Deepslate takes a different approach: plugins are Rust code compiled directly into the proxy binary.

You add deepslate as a library dependency, implement the Plugin trait, register event handlers, and build a custom binary for your server network. There's no classloader, no reflection overhead, and no runtime plugin loading.

use deepslate::{Proxy, ServerId};
use deepslate::event::*;
use deepslate::event::events::*;

const LOBBY: ServerId = ServerId::new("lobby", "127.0.0.1:25566");

struct MyPlugin;

impl Plugin for MyPlugin {
    fn register(&self, events: &mut EventManager) {
        events.subscribe::<LoginEvent>(PostOrder::NORMAL, |event| {
            if event.player.profile.name == "Steve" {
                event.set_result(LoginResult::Deny("Not allowed".into()));
            }
        });

        events.subscribe::<ChooseServerEvent>(PostOrder::NORMAL, |event| {
            event.set_result(LOBBY.into());
        });
    }
}

#[tokio::main]
async fn main() {
    let proxy = Proxy::builder()
        .forwarding_secret("your-secret")
        .server(&LOBBY)
        .try_servers([&LOBBY])
        .plugin(MyPlugin)
        .build()
        .expect("failed to build proxy");

    proxy.run().await.expect("proxy error");
}

Goals and non-goals

It's important to take a step back and manage expectations on what exactly Deepslate's scope is (and, maybe more importantly, isn't).

Goals

Non-goals

What's next?

Deepslate is at v0.3.0, and there's plenty still to do. Amongst other things, the roadmap includes: more events (chat, tab complete, resource pack handling), player messaging APIs for plugins, out-of-the-box feature parity with Velocity, and metrics/observability hooks.

If you want to try it out, the wiki has a quick start guide, and also covers configuration, the plugin API, events, and more.

There's also a few Docker Compose examples in the repository that showcase common proxy setups.

We have an issue tracker that's already populated with many planned tasks, and is open for anyone wishing to suggest a change or file a bug report.

Deepslate is dual-licensed under the MIT and Apache 2.0 licenses. Contributions are welcome, and certainly encouraged!