今日已更新 339 条资讯 | 累计 19899 条内容
关于我们

How to Put a Local Service on the Public Internet with FRP (Without Losing Your Mind Over Config Files)

ChenXX 2026年07月10日 17:55 3 次阅读 来源:Dev.to

The problem every self-hoster hits You built something. A local API. A Minecraft world for your friends. A self-hosted dashboard. An ERP running on the office machine. It works great — on your LAN. The moment you want someone outside to reach it, the fun begins: Port forwarding? Good luck if you're behind CGNAT, a corporate firewall, or an ISP that doesn't give you a public IP. VPN? Now every person who wants access has to install a client, join a network, and stay connected. Overkill for "let me show you this one page." Cloud deploy? Now you're maintaining two environments, paying for a VPS you didn't need, and shipping data somewhere it doesn't have to live. What most people actually want is simpler: take this one local port, give it a public address, done. That's exactly what FRP does. What FRP is FRP (Fast Reverse Proxy) is an open-source tool by fatedier that exposes a local service behind a NAT or firewall to the public internet. It's battle-tested, written in Go, and has been the go-to answer in self-hosting communities for years. The model is clean — two pieces: frps (the server) — runs on a machine with a public IP (a $5 VPS is plenty). frpc (the client) — runs on your local machine, the one with the service you want to expose. The client opens an outbound tunnel to the server. The server listens on a public port and forwards traffic back through the tunnel. NAT and firewalls don't matter because the connection is initiated from inside . [Visitor] → [frps on public VPS:7000] ⇄ tunnel ⇄ [frpc on your laptop] → [localhost:8080] That's the whole idea. It works for TCP, UDP, HTTP, HTTPS. People run Minecraft servers, remote desktops, internal dashboards, and dev previews through it every day. The catch: config files FRP works great. The friction isn't the protocol — it's the workflow . To run frpc , you write a TOML/INI config file: serverAddr = "203.0.113.10" serverPort = 7000 auth.token = "your-secret-key" [[proxies]] name = "my-web" type = "tcp" localIP = "1

本文内容来源于互联网,版权归原作者所有
查看原文