frp — Fast Reverse Proxy to Expose Local Servers Behind NATs and Firewalls
frp is a high-performance reverse proxy written in Go. Expose a local HTTP/TCP/UDP service to the public internet through a relay server — the self-hosted alternative to ngrok and Cloudflare Tunnel.
What it is
frp is a high-performance reverse proxy written in Go that exposes local HTTP, TCP, and UDP services to the public internet through a relay server. It is the self-hosted alternative to ngrok and Cloudflare Tunnel. You run a server component (frps) on a public VPS and a client component (frpc) on your local machine. Traffic routes through the relay.
This tool is for developers who need to expose local development servers, demo applications, or home lab services to the internet without complex networking setups.
How it saves time or tokens
frp eliminates the need for port forwarding, dynamic DNS, or VPN setup. A simple configuration file connects your local service to a public URL in seconds. Unlike ngrok, frp is self-hosted with no subscription limits on connections, bandwidth, or custom domains.
How to use
- Set up frps on a public server.
- Configure frpc on your local machine.
- Start both components.
- Access your local service via the public server's address.
# On your public server - run frps
./frps -c frps.toml
# On your local machine - run frpc
./frpc -c frpc.toml
Example
Server configuration (frps.toml):
bindPort = 7000
vhostHTTPPort = 80
vhostHTTPSPort = 443
Client configuration (frpc.toml):
serverAddr = 'your-server.com'
serverPort = 7000
[[proxies]]
name = 'web'
type = 'http'
localPort = 3000
customDomains = ['dev.your-server.com']
[[proxies]]
name = 'ssh'
type = 'tcp'
localPort = 22
remotePort = 6000
Now dev.your-server.com routes to your local port 3000, and SSH is accessible on port 6000.
Related on TokRepo
- DevOps tools — Networking and infrastructure tools
- Self-hosted solutions — Self-hosted alternatives
Common pitfalls
- You need a public server (VPS) to run frps. This is an ongoing cost, unlike free-tier ngrok.
- Unencrypted frp traffic can be intercepted. Enable TLS between frpc and frps for security.
- Exposing services to the internet creates security risks. Add authentication and access controls.
- frp does not provide automatic HTTPS certificates. Use a reverse proxy like Nginx with Let's Encrypt in front of frps.
- High traffic through frp adds latency compared to direct connections. The relay server becomes a bottleneck for bandwidth-intensive services.
- Review the official documentation before deploying to production to ensure compatibility with your specific environment and requirements.
- Start with default settings and customize incrementally. Changing too many configuration options at once makes debugging harder.
Frequently Asked Questions
frp is self-hosted and free. ngrok is a managed service with free and paid tiers. frp gives you full control but requires a public server. ngrok is easier to start with but has connection limits on free plans.
frp supports HTTP, HTTPS, TCP, UDP, and STCP (secret TCP for peer-to-peer connections). It can expose any network service that uses these protocols.
Yes. Point your domain's DNS to the frps server, and configure customDomains in the frpc config. frp routes traffic based on the HTTP Host header to the correct local service.
frp supports TLS encryption between client and server, token-based authentication, and IP allowlists. However, security is your responsibility. Configure TLS, use strong tokens, and limit exposed services.
Yes. Define multiple proxies in your frpc configuration, each mapping a different local port to a different public endpoint. One frps server can serve many frpc clients.
Citations (3)
- frp GitHub— frp is a fast reverse proxy written in Go
- frp Documentation— frp documentation and configuration
- Nginx Reverse Proxy Docs— Reverse proxy and tunneling concepts
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.