Skip to content

Rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.

egg-rathole.json

updated

Install

Installer image
ghcr.io/ptero-eggs/installers:debian
Install script
41 lines

Image

  • Rust ghcr.io/ptero-eggs/yolks:rust_latest

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

2 variables

Startup command

./rathole server.toml
  • VERSIONUsers can edit

    required|string|max:20

  • Your random token

    TOKENUsers can edit

    required|string|min:5|max:60A value is required.

Wings

Stop command
^C (SIGINT)
Running when the console shows
Listening at

Files Wings edits

Wings sets these values in these files before each start.

server.toml ini

server.bind_addr
"0.0.0.0:{{server.build.default.port}}"
server.services.test.token
"{{server.build.env.TOKEN}}"
server.services.test.bind_addr
"0.0.0.0:{{server.build.default.port}}"

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

Changes

  1. fix docker images path

    · Daniel Barton · 7d2b714

  2. Replace docker images

    · Daniel Barton · 3759ed6

  3. Add software

    · rowansc1 · 9b56a00

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 41 lines bash in ghcr.io/ptero-eggs/installers:debian Show
#!/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 "-----------------------------------------"