A fast and stable reverse proxy for NAT traversal, written in Rust

Overview

rathole

rathole-logo

A fast and stable reverse proxy for NAT traversal, written in Rust

rathole, like frp, can help to expose the service on the device behind the NAT to the Internet, via a server with a public IP.

Quickstart

To use rathole, you need a server with a public IP, and a device behind the NAT, where some services that need to be exposed to the Internet.

Assuming you have a NAS at home behind the NAT, and want to expose its ssh service to the Internet:

  1. On the server which has a public IP

Create server.toml with the following content and accommodate it to your needs.

# server.toml
[server]
bind_addr = "0.0.0.0:2333" # `2333` specifys the port that rathole listens for clients

[server.services.my_nas_ssh]
token = "use_a_secret_that_only_you_know" # Token that is used to authenticate the client for the service. Change to a arbitrary value.
bind_addr = "0.0.0.0:5202" # `5202` specifys the port that exposes `my_nas_ssh` to the Internet

Then run:

./rathole server.toml
  1. On the host which is behind the NAT (your NAS)

Create client.toml with the following content and accommodate it to your needs.

[client]
remote_addr = "myserver.com:2333" # The address of the server. The port must be the same with the port in `server.bind_addr`

[client.services.my_nas_ssh]
token = "use_a_secret_that_only_you_know" # Must be the same with the server to pass the validataion
local_addr = "127.0.0.1:22" # The address of the service that needs to be forwarded

Then run:

./rathole client.toml
  1. Now the client will try to connect to the server myserver.com on port 2333, and any traffic to myserver.com:5202 will be forwarded to the client's port 22.

So you can ssh myserver.com:5202 to ssh to your NAS.

Configuration

rathole can automatically determine to run in the server mode or the client mode, according to the content of the configuration file, if only one of [server] and [client] block is present, like the example in Quickstart.

But the [client] and [server] block can also be put in one file. Then on the server side, run rathole --server config.toml and on the client side, run rathole --client config.toml to explictly tell rathole the running mode.

Here is the full configuration specification:

[client]
remote_addr = "example.com:2333" # Necessary. The address of the server
default_token = "default_token_if_not_specify" # Optional. The default token of services, if they don't define their own ones

[client.services.service1] # A service that needs forwarding. The name `service1` can change arbitrarily, as long as identical to the name in the server's configuration
token = "whatever" # Necessary if `client.default_token` not set
local_addr = "127.0.0.1:1081" # Necessary. The address of the service that needs to be forwarded

[client.services.service2] # Multiple services can be defined
local_addr = "127.0.0.1:1082"

[server]
bind_addr = "0.0.0.0:2333" # Necessary. The address that the server listens for clients. Generally only the port needs to be change. 
default_token = "default_token_if_not_specify" # Optional

[server.services.service1] # The service name must be identical to the client side
token = "whatever" # Necesary if `server.default_token` not set
bind_addr = "0.0.0.0:8081" # Necessary. The address of the service is exposed at. Generally only the port needs to be change. 

[server.services.service2] 
bind_addr = "0.0.0.1:8082"

Benchmark

rathole has similiar latency to frp, but can handle more connections. Also it can provide much better bandwidth than frp.

See also Benchmark.

tcp_bitrate

tcp_latency

Development

rathole is in active development. A load of features is on the way:

  • UDP support
  • TLS transport
  • Hot reloading
  • HTTP APIs for configuration
Comments
  • Mipsel release not work

    Mipsel release not work

    I tried to exec rathole binaries on mipsel device and config it from examples, but it print nothing and usage 25% CPU(100% single thread), looks like be in infinite loop.

    CPU is MT7621AT, dual-core with quad-thread. System is Padavan 3.4.3.9-099_21-10-3, build by hiboyhiboyhiboy.

    opened by xinxin8816 16
  • 在 Openwrt procd init 脚本中设置 env `RUST_BACKTRACE=1` ,在哪里看到 log?

    在 Openwrt procd init 脚本中设置 env `RUST_BACKTRACE=1` ,在哪里看到 log?

    rathole 是安装在旁路由 openwrt 中。是从这里下载的 https://github.com/rapiz1/rathole/releases/download/v0.4.0/rathole-aarch64-unknown-linux-musl.zip

    主路由每晚4点30分会自动重启,重启后,server 端( docker 0.4.0 版) 大约在 4点47分左右 显示下面这样的 log

    Mar 21 04:47:43.964 ERROR connection{addr=xxx.xxx.197.12:56812}:handle{service=home_syncthing}:run: rathole::server: Failed to write control cmds: Operation timed out (os error 110)
    Mar 21 04:47:43.965  INFO connection{addr=xxx.xxx.197.12:56812}:handle{service=home_syncthing}:run: rathole::server: Control channel shutdown
    

    为了搞清什么问题,我在 openwrt 启动脚本 /etc/init.d/rathole 中 加了 RUST_BACKTRACE=1

    
    #!/bin/sh /etc/rc.common
    
    START=99 
    
    USE_PROCD=1
    
    PROG=/usr/sbin/rathole
    
    CONFIG=/etc/rathole/config.toml
    
    start_service() { 
        procd_open_instance
        procd_set_param env RUST_BACKTRACE=1
        procd_set_param command $PROG --client $CONFIG
        procd_set_param respawn 3600 10 50
        procd_close_instance
    }
    
    restart_service() {
       stop
       start
    }
    

    重启 op,rathole 能正常启动,但没找到地方看 log。。在 openwrt 的系统日志中也看不到 感觉是 env 没起作用,然后将脚本改成 procd_set_param command RUST_BACKTRACE=1 $PROG --client $CONFIG 结果 rathole 不能启动。。 我应该怎样 debug 呢?

    opened by moxuanyuan 13
  • Docker image

    Docker image

    Someone requests it and it should be easy to create one, though it doesn't seem quite useful to me. These days people are get used to just typing docker run.

    A Dockerfile can be created under the root of the project.

    enhancement 
    opened by rapiz1 12
  • DNS query of server adress every second

    DNS query of server adress every second

    Describe the bug

    i can see a dns request to A and AAAA record of the configured server EVERY SECOND in my log files.

    To Reproduce Steps to reproduce the behavior:

    1. dnstop -l 3 eth0
    2. Press 3 to see the queries

    Configuration

    [client]
    remote_addr = "xxx.xx:yy"
    ...
    

    Logs

    Queries: 2 new, 124 total                                                                                                                                                                                                                                                                           Fri Apr  8 13:02:31 2022
    
    Query Name        Count      %   cum%
    ------------- --------- ------ ------
    xxx.xx       122   100   100
    

    Environment:

    • OS: debian
    • rathole --version output: latest
    • CPU architecture: x64
    enhancement 
    opened by flo82 9
  • hot reload 在 docker 中是不是无效

    hot reload 在 docker 中是不是无效

    运行 docker run -it --rm -v "path/to/config.toml:/app/config.toml" rathole --server /app/config.toml 然后修改 path/to/config.toml,但是并没有触发 reload,只有重启上面运行的 container 才生效 是哪里没有配置好吗?

    opened by xspio 8
  • rathole::server: Failed to read hello

    rathole::server: Failed to read hello

    Describe the bug rathole server端频繁出现error日志 client和server可以正常通信

    To Reproduce Steps to reproduce the behavior:

    1. 启动server端之后一段时间就会出现这种情况

    Configuration Configuration used to reproduce the behavior:

    #server.toml
    [server]
    bind_addr = "0.0.0.0:7000" # `2333` specifies the port that rathole listens for clients
    
    [server.services.my_nas_ssh]
    token = "K8twY" # Token that is used to authenticate the client for the service. Change to a arbitrary value.
    bind_addr = "0.0.0.0:5000" # `5202` specifies the port that exposes `my_nas_ssh` to the Internet
    
    [server.services.my_asus]
    token = "K8twY"
    bind_addr = "0.0.0.0:5001"
    
    [server.services.my_haikang]
    token = "K8twY" 
    bind_addr = "0.0.0.0:5002"
    
    [client]
    remote_addr = "xxxx:7000"
    default_token = "K8twY"
    
    [client.services.my_nas_ssh]
    local_addr = "192.168.0.1:1025"
    
    [client.services.my_asus]
    local_addr = "192.168.0.1:80"
    

    Logs

    nohup: ignoring input
    Feb 11 15:19:21.776  INFO rathole::server: Listening at 0.0.0.0:7000
    Feb 11 15:19:21.776  INFO config_watcher{path="server.toml"}: rathole::config_watcher: Start watching the config
    Feb 11 15:19:22.637  INFO connection{addr=221.216.117.118:60892}: rathole::server: Try to handshake a control channel
    Feb 11 15:19:22.645  INFO connection{addr=221.216.117.118:50017}: rathole::server: Try to handshake a control channel
    Feb 11 15:19:22.655  INFO connection{addr=221.216.117.118:60892}: rathole::server: Control channel established service=my_nas_ssh
    Feb 11 15:19:22.655  INFO connection{addr=221.216.117.118:60892}:handle{service=my_nas_ssh}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:5000
    Feb 11 15:19:22.663  INFO connection{addr=221.216.117.118:50017}: rathole::server: Control channel established service=my_asus
    Feb 11 15:19:22.663  INFO connection{addr=221.216.117.118:50017}:handle{service=my_asus}:run_tcp_connection_pool: rathole::server: Listening at 0.0.0.0:5001
    Feb 11 16:22:31.616 ERROR connection{addr=139.59.11.135:33886}: rathole::server: Failed to read hello: early eof
    Feb 11 20:43:04.271 ERROR connection{addr=147.182.231.53:51530}: rathole::server: Failed to read hello: early eof
    Feb 11 21:22:48.898 ERROR connection{addr=83.97.20.34:32033}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 21:22:59.348 ERROR connection{addr=83.97.20.34:44769}: rathole::server: Failed to read hello: early eof
    Feb 11 21:22:59.600 ERROR connection{addr=83.97.20.34:58508}: rathole::server: Failed to deserialize hello: invalid value: integer `671088768`, expected variant index 0 <= i < 2
    Feb 11 21:23:10.762 ERROR connection{addr=83.97.20.34:10343}: rathole::server: Failed to read hello: early eof
    Feb 11 21:36:30.045 ERROR connection{addr=213.6.168.218:53265}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 21:36:31.087 ERROR connection{addr=213.6.168.218:53355}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 21:36:31.531 ERROR connection{addr=213.6.168.218:53558}: rathole::server: Failed to deserialize hello: invalid value: integer `197398`, expected variant index 0 <= i < 2
    Feb 11 22:31:59.848 ERROR connection{addr=8.142.23.67:60030}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 22:32:08.322 ERROR connection{addr=8.142.23.67:36068}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:15.952 ERROR connection{addr=8.142.23.67:46508}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:19.203 ERROR connection{addr=8.142.23.67:55428}: rathole::server: Failed to deserialize hello: invalid value: integer `638`, expected variant index 0 <= i < 2
    Feb 11 22:32:25.176 ERROR connection{addr=8.142.23.67:60604}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:33.467 ERROR connection{addr=8.142.23.67:42594}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:40.569 ERROR connection{addr=8.142.23.67:54110}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:41.813 ERROR connection{addr=8.142.23.67:34752}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 22:32:50.190 ERROR connection{addr=8.142.23.67:38882}: rathole::server: Failed to read hello: early eof
    Feb 11 22:32:52.098 ERROR connection{addr=8.142.23.67:45594}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 22:33:02.363 ERROR connection{addr=8.142.23.67:50432}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:06.202 ERROR connection{addr=8.142.23.67:35838}: rathole::server: Failed to deserialize hello: invalid value: integer `1229407554`, expected variant index 0 <= i < 2
    Feb 11 22:33:15.711 ERROR connection{addr=8.142.23.67:44772}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:23.291 ERROR connection{addr=8.142.23.67:52748}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:32.425 ERROR connection{addr=8.142.23.67:33012}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:34.242 ERROR connection{addr=8.142.23.67:41710}: rathole::server: Failed to deserialize hello: invalid value: integer `66326`, expected variant index 0 <= i < 2
    Feb 11 22:33:42.033 ERROR connection{addr=8.142.23.67:46484}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:44.908 ERROR connection{addr=8.142.23.67:54124}: rathole::server: Failed to deserialize hello: invalid value: integer `671088768`, expected variant index 0 <= i < 2
    Feb 11 22:33:52.979 ERROR connection{addr=8.142.23.67:57382}: rathole::server: Failed to read hello: early eof
    Feb 11 22:33:59.953 ERROR connection{addr=8.142.23.67:37312}: rathole::server: Failed to read hello: early eof
    Feb 11 22:34:07.715 ERROR connection{addr=8.142.23.67:47338}: rathole::server: Failed to read hello: early eof
    Feb 11 22:34:08.732 ERROR connection{addr=8.142.23.67:55454}: rathole::server: Failed to deserialize hello: invalid value: integer `58`, expected variant index 0 <= i < 2
    Feb 11 22:34:13.274 ERROR connection{addr=8.142.23.67:59080}: rathole::server: Failed to deserialize hello: invalid value: integer `1230262351`, expected variant index 0 <= i < 2
    Feb 11 22:34:17.082 ERROR connection{addr=8.142.23.67:36534}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 11 22:34:25.484 ERROR connection{addr=8.142.23.67:40924}: rathole::server: Failed to read hello: early eof
    Feb 11 22:34:31.826 ERROR connection{addr=8.142.23.67:49032}: rathole::server: Failed to read hello: early eof
    Feb 11 22:34:39.139 ERROR connection{addr=8.142.23.67:58018}: rathole::server: Failed to read hello: early eof
    Feb 12 01:06:58.354 ERROR connection{addr=45.155.205.127:63305}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 02:35:44.661 ERROR connection{addr=89.248.165.24:64736}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 03:08:53.713 ERROR connection{addr=83.97.20.34:42403}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 12 03:09:04.493 ERROR connection{addr=83.97.20.34:55301}: rathole::server: Failed to read hello: early eof
    Feb 12 03:09:04.794 ERROR connection{addr=83.97.20.34:12143}: rathole::server: Failed to deserialize hello: invalid value: integer `671088768`, expected variant index 0 <= i < 2
    Feb 12 03:09:15.160 ERROR connection{addr=83.97.20.34:31433}: rathole::server: Failed to read hello: early eof
    Feb 12 04:07:05.687 ERROR connection{addr=31.220.3.140:34398}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 12 05:20:57.872 ERROR connection{addr=89.248.163.191:33924}: rathole::server: Failed to read hello: early eof
    Feb 12 06:46:23.682 ERROR connection{addr=47.101.200.71:33674}: rathole::server: Failed to deserialize hello: invalid value: integer `197398`, expected variant index 0 <= i < 2
    Feb 12 09:06:28.299 ERROR connection{addr=83.97.20.34:19879}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 12 09:06:39.169 ERROR connection{addr=83.97.20.34:45711}: rathole::server: Failed to read hello: early eof
    Feb 12 09:06:40.430 ERROR connection{addr=83.97.20.34:55052}: rathole::server: Failed to deserialize hello: invalid value: integer `671088768`, expected variant index 0 <= i < 2
    Feb 12 09:06:52.572 ERROR connection{addr=83.97.20.34:2330}: rathole::server: Failed to read hello: early eof
    Feb 12 12:24:59.340 ERROR connection{addr=185.215.167.205:49752}: rathole::server: Failed to read hello: early eof
    Feb 12 12:27:52.476 ERROR connection{addr=193.106.29.74:64831}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 14:13:59.870 ERROR connection{addr=164.92.228.73:52560}: rathole::server: Failed to read hello: early eof
    Feb 12 14:46:57.080 ERROR connection{addr=195.54.167.183:64072}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 15:01:00.158 ERROR connection{addr=83.97.20.34:59847}: rathole::server: Failed to deserialize hello: invalid value: integer `542393671`, expected variant index 0 <= i < 2
    Feb 12 15:01:11.738 ERROR connection{addr=83.97.20.34:54290}: rathole::server: Failed to read hello: early eof
    Feb 12 15:01:11.925 ERROR connection{addr=83.97.20.34:35659}: rathole::server: Failed to deserialize hello: invalid value: integer `671088768`, expected variant index 0 <= i < 2
    Feb 12 15:01:22.576 ERROR connection{addr=83.97.20.34:3118}: rathole::server: Failed to read hello: early eof
    Feb 12 15:24:27.210 ERROR connection{addr=45.155.205.127:64391}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 15:43:15.551 ERROR connection{addr=45.155.205.127:64559}: rathole::server: Failed to deserialize hello: invalid value: integer `788529155`, expected variant index 0 <= i < 2
    Feb 12 15:44:07.719 ERROR connection{addr=80.66.88.12:7161}: rathole::server: Failed to deserialize hello: invalid value: integer `872415506`, expected variant index 0 <= i < 2
    

    Environment:

    • OS: CentOS Linux release 7.9.2009 (Core)
    • rathole --version output:
    rathole 
    Build Timestamp:     2022-01-21T16:24:41.600163352+00:00
    Build Version:       0.3.9
    Commit SHA:          Some("3cab131fc4294e689cd42f0eb4070e71b0e13537")
    Commit Date:         Some("2022-01-21T16:18:37+00:00")
    Commit Branch:       Some("detached HEAD")
    cargo Target Triple: x86_64-unknown-linux-musl
    cargo Profile:       release
    cargo Features:      base64,client,default,hot_reload,noise,notify,server,snowstorm,tls,tokio_native_tls
    
    • CPU architecture: Linux iZg7370jfvwvncZ 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    opened by justbelieveyourself 8
  • [example][systemd] use `DynamicUser=yes`

    [example][systemd] use `DynamicUser=yes`

    This patch fixes a warning generated by some new version of systemd. Use "User=nobody" seems to be considered unsafe. So maybe we need to fix it in our example files.

    [email protected] - Rathole Client Service
         Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
         Active: active (running) since Sat 2022-09-03 23:38:43 CST; 1h 27min ago
       Main PID: 507903 (rathole)
          Tasks: 14 (limit: 76731)
         Memory: 6.9M
            CPU: 39.908s
         CGroup: /system.slice/system-ratholec.slice/[email protected]
                 └─507903 /usr/local/bin/rathole -c /etc/rathole/hitmc.toml
    
    Sep 03 23:38:43 <hostname> systemd[1]: Started Rathole Client Service.
    ...
    Sep 03 23:39:25 <hostname> systemd[1]: /etc/systemd/system/[email protected]:7: Special user nobody configured, this is not safe!
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    

    Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969329 Link: https://github.com/trojan-gfw/trojan/issues/612 Link: https://www.vvave.net/archives/fix-the-systemd-error-special-user-nobody-configured-this-is-not-safe.html CC: @rapiz1

    opened by inclyc 7
  • 通过泛域名解析来管理物联网设备

    通过泛域名解析来管理物联网设备

    Feature Proposed

    目前使用FRP做的物联网设备管理. 使用泛域名解析的方式: *.device.abc.com 指向某ip地址; 所有设备通过设备ID上线: D001.device.abc.com; D002.device.abc.com D003.device.abc.com D004.device.abc.com

    需要连接 某设备时,使用DXXXdevice.abc.com可以连接过去 . 设备上线时,仅需要配置设备端,通过规则(设备ID+指定后缀)可访问到设备.

    目前Rathole是通过端口的方式转发映射,假设有1000个设备,就需要1000个端口对应起来,同时 Rathole目前没有APi的功能.

    如果管理N个设备,就需要通过N个设备的端口来访问,这不是不可以. 但是如果可以通过泛域名的方式来解决,或者可以很方便.

    看到Rathole里说到不做nginx的一些功能,但是这并不算Nginx的功能. 通过泛域名解析,可以给Rathole赋予更大的使命.

    目前我能想到的办法: Rathole通过端口映射了N个设备; Nginx通过泛域名访问到不同端口(LUNA也不是太麻烦 ) 这倒是可实现目前的需求. 有些曲折.

    Use Case

    enhancement 
    opened by zsinba 7
  • [Request] Wildcard DNS Support

    [Request] Wildcard DNS Support

    Would it be possible to add wildcard dns support? The project is amazing as it is but the ability to bind specific services to wildcard dns records while also passing the traffic to a specified port client side would be extremely useful. Keep up the good work, this project is the best tunnelling ive found so far.

    opened by VindicoRory 7
  • will you add proxy-protocol support?

    will you add proxy-protocol support?

    in order to be able to get normal IP addresses to the minecraft server. in order for the server to be able to receive external IP addresses of players.

    enhancement 
    opened by lootoos 6
  • external IP forward

    external IP forward

    The rathole server will take the external IP of the connected player and transfer it to the rathole client so that the players have the correct IP on the Minecraft game server

    The function will be useful for game servers\various sites

    enhancement 
    opened by lootoos 6
  • chore(deps): bump tokio from 1.21.2 to 1.23.1

    chore(deps): bump tokio from 1.21.2 to 1.23.1

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • In tunnel mode, without proxying functions

    In tunnel mode, without proxying functions

    Describe the feature request Is it possible to enable frp in tunnel mode without proxy functions? I make a tunnel through wireguard, I send packets to it using iptables -t nat -A PREROUTING -i ens3 -p tcp --dport 25565 -j DNAT --to 10.228.228.2:25565, so I keep the normal IP addresses of the players and also have UDP/TCP support But I tested such an implementation for downloading files, a file weighing 7GB is transmitted at a speed of 2MB/S, if you transfer the file via nginx then the speed is 2.5MB/S

    Describe alternatives you've considered Wireguard :"considered but not sure if it has the lowest ping", tunnel Proxied via nginx.

    enhancement 
    opened by lootoos 0
  • Android Build

    Android Build

    Feature Proposed Is it possible to build and run it in android device? we need NAT Traversal for some of our android devices to access it's port from the internet, i know rust is cross platform language and it can be build for android too, but i was wondering if there are any dependencies that prevents it or have anyone tested it ?

    Use Case We are using some scrapping services and we need to share our mobile data ips but without NAT Traversal i don't know any better way to achieve it.

    enhancement 
    opened by olivergibson 1
  • 100% CPU usage on arm build

    100% CPU usage on arm build

    Describe the bug If I run rathole as server on a t4g.small instance on AWS, the rathole process consumes 100% CPU on one core of the machine (50%).

    To Reproduce Steps to reproduce the behavior:

    Configuration Configuration used to reproduce the behavior:

    1. Configuration of systemd service.
    ❯ cat /etc/systemd/system/rathole.service
    [Unit]
    Description=Rathole Server Service
    After=network.target
    
    [Service]
    Type=simple
    #DynamicUser=yes
    Restart=on-failure
    RestartSec=5s
    ExecStart=/usr/local/bin/rathole -s /etc/rathole/rathole.toml
    LimitNOFILE=1048576
    
    [Install]
    WantedBy=multi-user.target
    
    1. config file
    ❯ cat /etc/rathole/rathole.toml
    # server.toml
    [server]
    bind_addr = "0.0.0.0:2333"
    default_token = "SECRET_IS_SAFE"
    
    [server.services.homelab_ssh]
    bind_addr = "0.0.0.0:3332"
    
    [server.services.homelab_rdp]
    bind_addr = "0.0.0.0:3333"
    
    [server.services.homelab_http]
    bind_addr = "0.0.0.0:80"
    
    [server.services.homelab_https]
    bind_addr = "0.0.0.0:443"
    

    Logs

    No special logs to show 100% CPU usage

    Environment:

    • OS:
    • rathole --version output:
    1. Rathole version
    rathole
    Build Timestamp:     2022-11-30T03:55:10.183120441Z
    Build Version:       0.4.7
    Commit SHA:          Some("ee5c7b4a770ef6c5b7ab5b21c1ee2c2f0a74f4f7")
    Commit Date:         Some("2022-11-30T03:49:01Z")
    Commit Branch:       Some("detached HEAD")
    cargo Target Triple: arm-unknown-linux-musleabihf
    cargo Profile:       release
    cargo Features:      base64,client,default,hot_reload,noise,notify,server,snowstorm,tls,tokio_native_tls
    

    I tried with rathole-arm-unknown-linux-musleabi as well. But it was exact same issue

    • CPU architecture:
    ❯ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=22.04
    DISTRIB_CODENAME=jammy
    DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
    ❯ uname -a
    Linux ip-172-31-22-66 5.15.0-1026-aws #30-Ubuntu SMP Wed Nov 23 17:01:09 UTC 2022 aarch64 aarch64
    aarch64 GNU/Linux
    
    bug 
    opened by dharapvj 1
  • convert frp config to rathole

    convert frp config to rathole

    how to use rathole and nginx to achieve the same result as these frp conf:

    server : frps.ini

    [common]
    bind_port = 7000
    vhost_http_port = 7080
    subdomain_host = example.com
    
    [plugin.authentication]
    addr = https://api.example.com 
    path = /tunnel_auth # authenticate using "user" and "meta_access_key"
    ops = Login
    tls_verify = false
    

    machine1 : frpc.ini

    [common]
    server_addr = example.com
    server_port = 7000
    user = client1
    meta_access_key = key1
    
    [http]
    type = http
    local_port = 8080
    subdomain = sub1
    http_user = u1
    http_pwd = p1
    

    machine2 : frpc.ini

    [common]
    server_addr = example.com
    server_port = 7000
    user = client2
    meta_access_key = key2
    
    [http]
    type = http
    local_port = 8080
    subdomain = sub2	
    http_user = u2
    http_pwd = p2
    
    enhancement 
    opened by shabakett 4
  • Request to support wss protocol between client and server

    Request to support wss protocol between client and server

    Feature Proposed

    Already know that 3 protocols are currently supported, they are ["tcp", "tls", "noise"]

    Use Case

    Request to support wss protocol between client and server

    enhancement 
    opened by aa51513 1
Releases(v0.4.7)
Owner
Yujia Qiao
Focus on Cloud Native & System Programming | GSoC 2020 @chapel-lang | Pursuing Bachelor's Degree @ HUST @UniqueStudio
Yujia Qiao
Reliable p2p network connections in Rust with NAT traversal

Reliable p2p network connections in Rust with NAT traversal. One of the most needed libraries for any server-less, decentralised project.

MaidSafe-Archive 948 Dec 20, 2022
A TCP proxy using HTTP - Reach SSH behind a Nginx reverse proxy

?? TCP over HTTP ?? The Questions ?? What does it do? You can proxy TCP traffic over HTTP. A basic setup would be: [Your TCP target] <--TCP-- [Exit No

Julian 185 Dec 15, 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
Hopper - Fast, configurable, lightweight Reverse Proxy for Minecraft

Hopper Hopper is a lightweight reverse proxy for minecraft. It allows you to connect multiple servers under the same IP and port, with additional func

Pietro 174 Jun 29, 2023
Reverse proxy for HTTP microservices and STDIO. Openfass watchdog which can run webassembly with wasmer-gpu written in rust.

The of-watchdog implements an HTTP server listening on port 8080, and acts as a reverse proxy for running functions and microservices. It can be used independently, or as the entrypoint for a container with OpenFaaS.

yanghaku 7 Sep 15, 2022
Web3-proxy: a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers.

web3-proxy Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers. Signed transactions (eth_sendRawTrans

null 55 Jan 8, 2023
A multi-connection TCP reverse proxy server and client.

tprox A multi-connection TCP reverse proxy. The tprox server is able to proxy multiple incoming connections to the tprox client over a single TCP conn

Mohammed Ajmal Siddiqui 4 Sep 21, 2022
A high performence Socks5 proxy server with bind/reverse support implementation by Rust.

rsocx A high performence Socks5 proxy server with bind/reverse support implementation by Rust Features Async-std No unsafe code Single executable Linu

b23r0 259 Jan 6, 2023
A lightweight Rust reverse proxy.

Brachyura A reverse proxy, which I am primarily using as a Rust / Hyper learning project. I utilize Nginx as part of my home lab providing reverse pro

William Howard 8 Jan 8, 2023
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 firewall reverse proxy for preventing Log4J (Log4Shell aka CVE-2021-44228) attacks.

log4jail ??️ A fast firewall reverse proxy with TLS (HTTPS) and swarm support for preventing Log4J (Log4Shell aka CVE-2021-44228) attacks. ?? Table of

Mufeed VH 22 Dec 27, 2022
A modern, simple TCP tunnel in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls

bore A modern, simple TCP tunnel in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls. That's all it does:

Eric Zhang 6.2k Dec 31, 2022
UDP proxy with Proxy Protocol and mmproxy support

udppp UDP proxy with Proxy Protocol and mmproxy support. Features Async Support Proxy Protocol V2 SOCKET preserve client IP addresses in L7 proxies(mm

b23r0 10 Dec 18, 2022
Proxy sentry request to a sentry server using a tunnel/proxy endpoint

Sentry Tunnel This is a proxy that forwards tunneled sentry requests to the real sentry server. The implementation is based on the explanation provide

Paul FLORENCE 14 Dec 20, 2022
Lightweight proxy that allows redirect HTTP(S) traffic through a proxy.

Proxyswarm Proxyswarm is a lightweight proxy that allows redirect HTTP(S) traffic through a proxy. WARNING: This app isn't recomended for download lar

Jorge Alejandro Jimenez Luna 4 Apr 16, 2022
A fast, offline reverse geocoder in Python

Reverse Geocoder A Python library for offline reverse geocoding. It improves on an existing library called reverse_geocode developed by Richard Penman

Ajay Thampi 1.8k Dec 26, 2022
RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust

Cris Liao 16 Dec 4, 2022
Simple and fast layer 4 proxy in Rust

Fourth 这一波在第四层。 English Fourth是一个Rust实现的Layer 4代理,用于监听指定端口TCP流量,并根据规则转发到指定目标。 功能 监听指定端口代理到本地或远端指定端口 监听指定端口,通过TLS ClientHello消息中的SNI进行分流 安装方法 为了确保获得您架构

Rui Li 17 Nov 8, 2022
A proxy implement with http / socks5 in-bound and vmess out-bound, written in Rust and tokio.rs

tokio-vmess an Asynchronous proxy implement with http / socks5 in-bound and vmess out-bound, written in Rust and tokio Run example first, Fill out the

irumeria 7 Oct 3, 2022