> For AI agents: the complete documentation index is available at https://www.tteam.icu/llms.txt, the full documentation bundle is available at https://www.tteam.icu/llms-full.txt.

# rathole内网穿透

[开源地址](https://github.com/rathole-org/rathole)

比 [frp](https://www.tteam.icu/ops/service/frp.md) 更快、占用资源更小；但新增配置时需要两端都添加。

## 启动

```sh file="./rathole/setup.sh" title="setup.sh"
#!/bin/bash

docker rm -f rathole

docker run -id \
--restart=always \
--network host \
--name rathole \
-v ./config.toml:/app/config.toml \
rapiz1/rathole \
/app/config.toml

# ghcr.io/rathole-org/rathole:dev
```

## 配置


**server.toml**

```toml file="./rathole/server.toml"
[server]
bind_addr = "0.0.0.0:44052"
default_token = "csha89sch9ah"

[server.services.home_nginx_http_port]
type = "tcp"
bind_addr = "0.0.0.0:20001"

[server.services.home_socks5_proxy_port]
type = "tcp"
bind_addr = "0.0.0.0:20002"

```


**client.toml**

```toml file="./rathole/client.toml"
[client]
remote_addr = "4.34.567.4:44053"
default_token = "csha89sch9ah"

[client.services.home_nginx_http_port]
type = "tcp"
local_addr = "127.0.0.1:80"

[client.services.home_socks5_proxy_port]
type = "tcp"
local_addr = "127.0.0.1:10900"

```

