September 14, 2024
ngrok alternative²: frp + Caddy + Lets Encrypt
Update of ngrok alternative: localtunnel + Caddy + Lets Encrypt but using frp - fast reverse proxy.
In addition to the default setup, we are adding multiuser auth support using frp server plugin.
Setup frps - server prepare dedicated user and folders: sudo useradd -m -s /bin/bash -b /var/lib -r frp sudo install -d -o frp -g frp -m 700 /etc/frp fetch binary from frp releases. Example: release=0.60.0 curl -sfL "https://github.com/fatedier/frp/releases/download/v${release}/frp_${release}_linux_amd64.tar.gz" | sudo tar -xzf - -C /usr/local/bin --strip-components=1 "frp_${release}_linux_amd64/frps" create config file /etc/frp/frps.toml according to your needs. I’ll use this example for now: bindPort = 7000 vhostHTTPPort = 7001 webServer.port = 7500 subDomainHost = "your-subdomain.example.com" [[httpPlugins]] name = "user-login" addr = "127.0.0.1:8000" path = "/login" ops = ["Login"] create systemd unit: add the following to /etc/systemd/system/frp-server.service [Unit] Description=frp (fast reverse proxy) - server After=network.target Documentation=https://github.com/fatedier/frp [Service] ExecStart=/usr/local/bin/frps --config /etc/frp/frps.toml User=frp Group=frp Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target start and enable: systemctl enable --now frp-server.service Caddy We will also setup protection for the wildcard subdomains to only issue certificates for subdomains registered with frp using a custom ask endpoint.
Read more