2022-02-21 02:12:17 +09:00
2022-02-21 02:12:05 +09:00
2022-02-21 02:12:17 +09:00
2022-02-21 02:12:08 +09:00
2020-05-08 23:42:54 +08:00
2022-02-21 02:12:07 +09:00
2022-02-21 02:12:17 +09:00
2022-02-21 02:12:17 +09:00
2020-05-14 14:26:00 +08:00
2022-02-21 02:12:17 +09:00
2020-05-11 23:50:07 +08:00
2022-02-21 02:12:02 +09:00

realm realm

中文说明

Introduction

realm is a simple, high performance relay server written in rust.

Features

  • Zero configuration. Setup and run in one command.
  • Concurrency. Bidirectional concurrent traffic leads to high performance.
  • Low resources cost.

Custom Build

available Options:

  • udp (enabled)
  • trust-dns (enabled)
  • zero-copy (enabled on linux)
  • tfo (disabled)
  • mi-malloc (enabled)
  • jemalloc
# simple tcp
cargo build --release --no-default-features

# enable other options
cargo build --release --no-default-features --features udp, tfo, zero-copy, trust-dns

Usage

Realm 1.5.0-rc5

A high efficiency relay tool

USAGE:
    realm [FLAGS] [OPTIONS]

FLAGS:
    -u, --udp       enable udp forward
    -f, --tfo       enable tcp fast open
    -z, --splice    enable tcp zero copy
    -d, --daemon    run as a unix daemon

OPTIONS:
    -c, --config <path>           use config file
    -l, --listen <addr>           listen address
    -r, --remote <addr>           remote address
    -x, --through <addr>          send through ip or address
        --tcp-timeout <second>    set timeout value for tcp
        --udp-timeout <second>    set timeout value for udp

start from command line arguments:

# enable udp
realm -l 127.0.0.1:5000 -r 1.1.1.1:443 --udp

# specify outbound ip
realm -l 127.0.0.1:5000 -r 1.1.1.1:443 --through 127.0.0.1

or use a config file:

realm -c config.json

Configuration

Example
{
	"log": {
		"level": "warn",
		"output": "/var/log/realm.log"
	},
	"dns_mode": {
		"mode": "ipv4_only",
		"protocol": "tcp+udp",
		"nameservers": ["8.8.8.8:53", "8.8.4.4:53"]
	},
	"endpoints": [
		{
			"local": "0.0.0.0:5000",
			"remote": "1.1.1.1:443"
		},
		{
			"local": "0.0.0.0:10000",
			"remote": "www.google.com:443",
			"udp": true,
			"fast_open": true,
			"zero_copy": true
		},
		{
			"local": "0.0.0.0:15000",
			"remote": "www.microsoft.com:443",
			"through": "127.0.0.1"
		}
	]
}

global: [log, dns, endpoints]

Note: must provide endpoint.local and endpoint.remote


log: [level, output]

log.level

  • off
  • error
  • info (default)
  • debug
  • trace

log.output

  • stdout (default)
  • stderr
  • path, e.g. (/var/log/realm.log)

dns: [mode, protocol, nameservers]

this is compatibe with old versions(before v1.5.0-rc3), you could still set lookup priority with "dns_mode": "ipv4_only", which is equal to "dns_mode": {"mode": "ipv4_only"}

dns.mode

  • ipv4_only
  • ipv6_only
  • ipv4_then_ipv6 (default)
  • ipv6_then_ipv4
  • ipv4_and_ipv6

dns.protocol

  • tcp
  • udp
  • tcp+udp (default)

dns.nameservers

format: ["server1", "server2" ...]

default: On unix/windows, it will read from the default location.(e.g. /etc/resolv.conf). Otherwise use google's public dns as default upstream resolver(8.8.8.8, 8.8.4.4 and 2001:4860:4860::8888, 2001:4860:4860::8844).


endpoint objects

  • local: listen address
  • remote: remote address
  • through: send through specified ip or address, this is optional
  • udp: true|false, default=false
  • zero_copy: true|false, default=false
  • fast_open: true|false, default=false
  • tcp_timeout: tcp timeout(sec), default=300
  • udp_timeout: udp timeout(sec), default=30
S
Description
A network relay tool
Readme MIT
1.2 MiB
Languages
Rust 99.1%
C 0.3%
Dockerfile 0.3%
C++ 0.2%
Makefile 0.1%