Self-hosted, fast, and efficient replacement for ngrok, built with Rust

Overview

reverse-proxy

reverse-proxy is a self-hosted, fast, and efficient replacement for ngrok, built with Rust. The project leverages the power of Tokio and Actix to ensure high performance and reliability.

Features

  • Written in Rust for optimal performance and safety
  • Self-hosted and easy to deploy
  • HAProxy header support for easy integration with existing services

License

This project is licensed under the GNU GPLv3 license. See the LICENSE file for more information.

Tunnels

reverse-proxy supports two modes of tunneling: Reverse and HolePunch. Tunneling currently only supports TCP connections. HAProxy V1 and V2 headers can be enabled for easy integration with existing services (e.g. for Minecraft servers: Velocity has HAProxy support).

Reverse

Reverse tunnels are the default mode of tunneling. In this mode, the client connects to the edge server, and the edge server forwards the connection to the target server.

HolePunch

HolePunch tunnels are useful for environments where the edge server cannot connect to the target server (e.g. NAT, firewall, etc.). In this mode, the client connects to the edge server, and the edge server uses a connected worker (initiated by the target server) to forward the connection to the target server.

Usage

Currently, we do not provide pre-built binaries. You will need to build the project yourself. You can do so by running cargo build --release. The binaries will be located in target/release (edge and client).

Edge Server

The edge server is the server that clients connect to. The edge server is responsible for forwarding connections to the target server. You should run this on a server with a public IP address and support for port forwarding (e.g. a VPS).

Before running the edge server, you will need to create a configuration file (config.toml). An example configuration file is provided below:

port = 4120 # Port to listen on

# ./edge add-user <name> [max tunnels]
# ./edge delete-user <name or secret key>
[secrets.example]
max_tunnels = 999
key = "example123"

Once you have created a configuration file, you can run the edge server by running ./edge serve.

Client

The client should be run on the server that hosts the service you want to expose. You will need to create a configuration file before running the client (config.toml). An example configuration file is provided below:

secret_key = "example123"      # Secret generated by the edge
edge = "http://localhost:4120" # Edge API url, can be behind a reverse proxy
edge_ip = "127.0.0.1"          # Edge IP, used for connections
idle_workers = 5               # Number of idle workers, only used for HolePunch mode

[tunnels.example-web]
target = "localhost:8000" # Target address, can be a domain, port must be specified
protocol = "Tcp"          # Tcp, HAProxyV1, HAProxyV2
mode = "Reverse"          # Reverse, HolePunch

[tunnels.example-mc]
target = "localhost:25565"
protocol = "HAProxyV1"
mode = "HolePunch"

Once you have created a configuration file, you can run the client by running ./client.

You might also like...
The gRPC library for Rust built on C Core library and futures

gRPC-rs gRPC-rs is a Rust wrapper of gRPC Core. gRPC is a high performance, open source universal RPC framework that puts mobile and HTTP/2 first. Sta

A multiplayer web based roguelike built on Rust and WebRTC
A multiplayer web based roguelike built on Rust and WebRTC

Gorgon A multiplayer web-based roguelike build on Rust and WebRTC. License This project is licensed under either of Apache License, Version 2.0, (LICE

The true next-gen L7 minecraft proxy and load balancer. Built in Rust.

Lure The true next-gen L7 minecraft proxy and load balancer. Built in Rust, Tokio and Valence. Why? Rust is a powerful programming language and a grea

Minimal DNS server built in Rust with rule system and logging.

MinDNS MinDNS is a minimal DNS server written in Rust. It is intended to be used as a firewall, black-hole or proxy DNS server. ⚡ Features Fully async

Revolt backend API server, built with Rust.

Delta Description Delta is a blazing fast API server built with Rust for Revolt. Features: Robust and efficient API routes for running a chat platform

A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

HTTP Server Tester This is a CLI test program for HNU Cloud Computing Lab 2. Install For most student, you don't neet to rebuild this project. We prov

STAC server, built in Rust, backed by pgstac

stac-server-rs A simple STAC server written in Rust. To run an example server: stac-server 0.0.0.0:3000 example-config.toml --href data/joplin/collect

A sample API Gateway built in Rust (work in progress) for learning purposes

rust-api-gateway A sample API Gateway built in Rust (work in progress) for learning purposes. You can follow along by reading the tutorial articles: P

Easy per application transparent proxy built on cgroup.

cproxy can redirect TCP and UDP traffic made by a program to a proxy, without requiring the program supporting a proxy. Compared to many existi

Owner
null
A minimal ngrok liked reverse proxy implemented in Rust.

rok A minimal ngrok implementation in Rust, for educational purpose. This work is largely based on rathole, especially the very first commit. Other ho

Kai 3 Jun 21, 2022
A tcp port forwarding system like ngrok.

Pruxy A tcp port forwarding system like ngrok. Todo http request handler agent <-> server connection agent How to use Generate cert files mkdir ssl_ce

null 1 Jan 24, 2022
A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

editso 1.3k Dec 30, 2022
A simple ping utility written in Rust, that is focused on being size efficient and fast.

MeowPing MeowPing is a command-line utility for testing network connectivity using ICMP echo requests or TCP connections. It provides similar function

enty 3 Feb 28, 2024
A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address.

innisfree A tool to aid in self-hosting. Expose local services on your computer, via a public IPv4 address. Why? Most of the data I maintain is local,

Conor Schaefer 7 Mar 19, 2022
Minimal self-contained crate to accept file descriptors from systemd

sd-listen-fds Exposes file descriptors passed in by systemd, the Linux init daemon, without dependencies, foreign or otherwise. Enables easy implement

Benjamin Saunders 3 Aug 14, 2023
♻ A simple and efficient Gemini-to-HTTP proxy written in Rust.

September A simple and efficient Gemini-to-HTTP proxy written in Rust. Usage Docker $ docker run -d [ -e ROOT="gemini://fuwn.me" ] [ -e PORT="8080"] [

GemRest 10 Jul 2, 2022
A versatile and efficient proxy framework with nice features suitable for various use cases.

A versatile and efficient proxy framework with nice features suitable for various use cases.

null 1.7k Jan 9, 2023
An efficient web server for TiddlyWikis.

Tiddlywiki Server This is a web backend for TiddlyWiki. It uses TiddlyWiki's web server API to save tiddlers in a [SQLite database]. It should come wi

Nathaniel Knight 17 Nov 19, 2022
An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

null 2 Apr 27, 2022