Skip to content

Hopper - Fast, configurable, lightweight Reverse Proxy for Minecraft

License

Notifications You must be signed in to change notification settings

1ntent1on/hopper-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hopper License

Hopper is a lightweight reverse proxy for minecraft. It allows you to connect multiple servers under the same IP and port, with additional functionalities, just like Nginx. It is built with Rust 🦀 to ensure maximum performance and efficiency.

Hopper works starting from version 1.7 up to the latest version of Minecraft.

NOTE: this proxy is still heavily under development, and a lot of new features are coming really soon!

FEATURES:

  • Load balancing
  • IP Forwarding
  • Webhook callbacks for events
  • support for influxdb metrics

Configuration

Example Config.toml:

# the address hopper will listen on
listen = "0.0.0.0:25565"

# general routing configuration
[routing]
default = { ip = "127.0.0.1:12345" } # optional
# default = { ip = ["127.0.0.1:12001", "127.0.0.1:12002"] } # load balanced

# list of servers fronted by hopper
[routing.routes]
# simple reverse proxy
"mc.gaming.tk" = { ip = "127.0.0.1:25008" }

# bungeecord's ip forwarding feature enabled
"mc.server.com" = { ip-forwarding = true, ip "127.0.0.1:25123" }

# this will load balance between the two servers
"other.gaming.tk" = ["127.0.0.1:25009", "10.1.0.1:25123"]

IP Forwarding

Without IP Forwarding, when servers receive connections from this reverse proxy they won't see the original client's ip address. This may lead to problems with sessions with plugins such as Authme. Hopper implements the same "protocol" BungeeCord uses (old but very compatible with all Minecraft versions).

⚠️ Note: you will also need to enable the bungeecord directive in your server's configuration files. Click here to learn more.

You can enable ip forwarding per-server on hopper with the "ip-forwarding" directive like this:

[routing.routes."your.hostname.com"]
ip-forwarding = true # defaults to false
ip = "<your server ip>"

How to run

There are two ways to run hopper:

Docker GitHub Workflow Status

  • Pull the latest image from the GitHub registry:
docker pull ghcr.io/bra1l0r/hopper-rs
  • Create a Config.toml (NOTE: the port you will specify must match the exposed port below)
  • Run it using docker:
docker run -d -p 25565:25565 -v /home/user/path-to/Config.toml:/Config.toml ghcr.io/bra1l0r/hopper-rs

Using docker-compose (recommended):

# new versions of compose don't require this anymore
version: '3'

services:
  hopper:
    image: ghcr.io/bra1l0r/hopper-rs
    ports:
      - 25565:25565
    volumes:
      - ./Config.toml:/Config.toml

Binary GitHub Workflow Status

You can either download the latest release (recommended) or follow the steps below to build your own binary:

  • Download and install the latest version of the rustc toolchain
  • Clone and build the repo:
# Clone the repo into hopper-rs and enter the directory
git clone https://github.com/BRA1L0R/hopper-rs
cd hopper-rs/

# Build the project with the release profile
cargo build --release
  • The runnable binary will now be available at target/release/hopper

TODO: running information with systemd configuration example

Upcoming features

  • add support for influxdb metrics (or similar)
  • rest api for metrics and operation
  • webhook callbacks for events
  • benchmark comparison with similar programs

About

Hopper - Fast, configurable, lightweight Reverse Proxy for Minecraft

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 98.3%
  • Dockerfile 1.7%