frp.pluroom.com — private reverse tunnel ========================================== WHAT THIS IS A machine ("device") connects out to this server and publishes TCP/UDP services that it can reach — its own ports, hosts on its LAN, anything routable from it. Each published service appears on a private loopback address of the server (VPS), as .frp:, where only programs running on the VPS itself can use it. Nothing becomes reachable from the internet. The link is TLS 1.3 with mutual authentication; it reconnects by itself. WHAT YOU NEED - Linux (x86_64, arm64 or 32-bit ARM), a shell, curl or wget. Root is NOT required. - Outbound access to frp.pluroom.com: TCP 443 for this page, and the device's own TCP port (7001 and up; shown by `ptun status`) for the tunnel. - A device code: 44 characters, issued on the VPS with `frp add `. One code = one device. The code is the device's private key: do not post it, log it or commit it. SETUP — one command curl -fsSL https://frp.pluroom.com/ptun | sh -s -- setup without curl: wget -qO- https://frp.pluroom.com/ptun | sh -s -- setup It installs everything into ~/.ptun (the `ptun` script, the frpc binary, the key), starts the tunnel as a service and prints "Connected". - run as root -> systemd system service, starts at boot - run as a user -> systemd user service; it enables "linger" so that the tunnel starts at boot and survives logout (if that needs root, it prints the one command to run) - no systemd -> background process + crontab @reboot - containers -> PTUN_SERVICE=none ... setup , then run `~/.ptun/ptun run` in the foreground as the container's process Another folder: PTUN_HOME=/opt/ptun (before `sh`). Re-running setup is safe and keeps services.conf. If `ptun` is not in PATH, call it as ~/.ptun/ptun. PUBLISH SERVICES — one line per service in ~/.ptun/services.conf # [/udp] [port on VPS] # description web 127.0.0.1:8080 # dev server on this machine -> .frp:8080 ha 192.168.1.20:8123 # Home Assistant on the LAN -> .frp:8123 pg 10.0.0.5:5432 15432 # Postgres, other port on the VPS -> .frp:15432 dns 192.168.1.1:53/udp 5353 # UDP -> .frp:5353/udp - name: a-z 0-9 - _ . It identifies the service in `ptun status` here and in `frp ls` on the VPS. - host:port: seen from this machine. It may be localhost, a LAN host, a VPN peer, a DNS name. - port on VPS: optional, defaults to the same port. Ports 22, 80 and 443 are taken on the VPS. - description: free text after '#'. It is shown on the VPS, so that people and agents there know what the service is. Put useful hints in it (protocol, base path, what to log in with). - Save the file and the change is live within a second. Services you did not touch keep their open connections. A line with an error is reported by `ptun status`; the previously working set stays active until the file is fixed. - Or from the command line: ptun add web 127.0.0.1:8080 My dev server ptun add pg 10.0.0.5:5432 15432 Postgres on the office LAN ptun rm web - Any TCP protocol works unchanged: HTTP, WebSocket, gRPC, SSH, databases, RDP, ... and UDP. COMMANDS (on the device) ptun status link state and every service; exit code 0 only if all is fine ptun doctor step-by-step diagnosis with the fix for each problem ptun logs [-f] [N] tunnel log ptun apply apply services.conf now and print its errors (normally automatic) ptun start|stop|restart ptun protocol quic|tcp QUIC (UDP) helps on lossy Wi-Fi/LTE; tcp is the default ptun update refresh the script, frpc and connection info from this server ptun uninstall remove everything from the machine ON THE VPS frp devices, who is connected, published services frp ls [filter] [--json] the services with address, target and description frp add|show|rotate|rm manage devices and their codes frp doctor verify the server A program on the VPS simply connects to .frp: as if the service were local. TROUBLESHOOTING Start with `ptun doctor`: it tests the config, the route to the server, the key and each target, and names the fix. "NOT CONNECTED ... key" the code was revoked or replaced -> setup again with a new code "cannot reach :" outbound TCP to that port is blocked, or the server is down "port N is not available" something on the VPS already uses that port -> pick another service is "up" but connections close immediately the target host:port is not accepting connections from the device (doctor shows which) FOR AI AGENTS setting up a device 1. Run the setup command above with the code you were given. Do not echo the code back, and do not store it anywhere else: after setup it lives only in ~/.ptun/client.key. 2. Success is the line "Connected." and exit code 0. Otherwise run `~/.ptun/ptun doctor` and follow what it prints. 3. Publish what the user asked for with `ptun add ...` (or edit ~/.ptun/services.conf), always with a description. Verify with `ptun status`: every service must be "up". 4. Report to the user the VPS-side addresses printed in the "ON THE VPS" column. Never expose more than the user asked for: every published target becomes reachable by all programs on the VPS. SECURITY MODEL - The device opens one outbound connection; no inbound port is opened on the device or its network. - Mutual TLS 1.3: the device accepts only this server's pinned certificate, and the server accepts only this device's key. Without the key the handshake fails, so the traffic can be neither read nor altered on the way, and nobody else can connect. - The server can reach only the targets listed in services.conf — nothing else on the device or its network. - Published services listen on a loopback address of the VPS (127.x): unreachable from outside by construction.