Open tarokeitaro opened 3 months ago
用了一段时间,感觉不稳定,有个端口连不上了,另外一个端口能连但很慢,重启 client 才好,换回 frp了。。
2月21开始用的,用到现在,用了 20 天左右
长期用大半年了,基本上只能维持三五天不报错,相当不稳定
看上去,作者参加工作后就没时间理会这个项目了
长期用大半年了,基本上只能维持三五天不报错,相当不稳定
anyone got a solution? this tool is good, but its not that stable, and I still need it.
@tarokeitaro you can use frp instead currently.
8k star却没人能提commit给项目续命 真是悲哀啊
@tarokeitaro
This is what I have in Cron every 6 hours, it will check for Connection timed out (os error 110)
in the container logs. If found, this will run the following command
cd /docker
docker compose up -d --force-recreate rathole
Of course, you can customize it, I have it this way because my rathole container is in a massive docker-compose.yml file with a lot of other containers
After it restarts/fails to restart or doesn't find the string Connection timed out (os error 110)
, it will send a discord notification
#!/bin/bash
# Define container name (assuming it matches the service name in docker-compose.yml)
container_name="rathole" # Replace if your service name is different
# Error string to search for
error_string="Connection timed out (os error 110)"
# Discord webhook URL (replace with your actual webhook URL)
webhook_url=""
# Function to send Discord notification
function send_discord_notification() {
message="$1"
content="$message"
curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"Rathole\", \"content\": \"$content\"}" "$webhook_url"
}
# Get container logs
logs=$(docker logs $container_name)
# Check if error string exists in logs
if grep -q "$error_string" <<< "$logs"; then
message="Error '$error_string' found in logs. Recreating container..."
echo "$message"
send_discord_notification "$message"
# Change directory to /docker (assuming your docker-compose.yml is there)
cd /docker
# Recreate container using docker-compose
docker compose up -d --force-recreate rathole
recreate_result=$?
if [ $recreate_result -eq 0 ]; then
message="Container $container_name recreated successfully."
else
message="Error: Failed to recreate container $container_name."
fi
echo "$message"
send_discord_notification "$message"
else
message="Error string $error_string not found in logs. Container $container_name seems healthy."
echo "$message"
send_discord_notification "$message"
fi
rathole:
image: rapiz1/rathole:latest
container_name: rathole
networks:
- proxy
restart: unless-stopped
command: --client /app/config.toml
volumes:
- $DOCKERDIR/rathole/client.toml:/app/config.toml
# client.toml
[client]
remote_addr = "x.x.x.x:2333" # The address of the server. The port must be the same with the port in `server.bind_addr`
heartbeat_timeout = 20 # Optional. Set to 0 to disable the application-layer heartbeat test. The value must be greater than `server.heartbeat_interval`. Default: 40 seconds
retry_interval = 1 # Optional. The interval between retry to connect to the server. Default: 1 second
[client.services.galax_https]
token = "" # Must be the same with the server to pass the validation
local_addr = "traefik:443" # The address of the service that needs to be forwarded
[server]
bind_addr = "0.0.0.0:2333" # `2333` specifies the port that rathole listens for clients
heartbeat_interval = 10
[server.services.galax_https]
token = "" # Token that is used to authenticate the client for the service. Change to a arbitrary value.
bind_addr = "0.0.0.0:443" # `5202` specifies the port that exposes `my_nas_ssh` to the Internet
these are the settings on my vps (Public IP)
Server Log:
and these are the settings on my local server (Dynamic IP behind NAT)
local log: