Rathole
applicationsA lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
README
Rathole
A secure, stable and high-performance reverse proxy for NAT traversal, written in Rust
rathole, like frp and ngrok, can help to expose the service on the device behind the NAT to the Internet, via a server with a public IP.
This egg only includes server side of rathole
Please refer to https://github.com/rapiz1/rathole for more information about rathole
Docker Images (1)
| Name | Image |
|---|---|
ghcr.io/ptero-eggs/yolks:rust_latest | ghcr.io/ptero-eggs/yolks:rust_latest |
Startup Command
./rathole server.toml Variables (2)
Version
- Environment:
VERSION- Default:
latest- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:20
Secret
Your random token
- Environment:
TOKEN- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|min:5|max:60
Installation Script
Container:
ghcr.io/ptero-eggs/installers:debianEntrypoint:
bash#!/bin/bash
## get release info and download links
mkdir -p /mnt/server
cd /mnt/server
LATEST_JSON=$(curl --silent "https://api.github.com/repos/rapiz1/rathole/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/rapiz1/rathole/releases")
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "aarch64")
if ["${ARCH}" == "aarch64"]; then
MATCH=rathole-aarch64-unknown-linux-musl.zip
else
MATCH=rathole-x86_64-unknown-linux-gnu.zip
fi
if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
else
echo -e "defaulting to latest release"
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
fi
fi
echo "Download url: ${DOWNLOAD_URL}"
curl -ssL -o rathole.zip ${DOWNLOAD_URL}
unzip rathole.zip
rm rathole.zip
touch server.toml
printf "[server]\nbind_addr=\"0.0.0.0:${SERVER_PORT}\"\n\n[server.services.test]\ntoken=\"${TOKEN}\"\nbind_addr=\"0.0.0.0:${SERVER_PORT}\"" > server.toml
chmod +x rathole
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"