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.
Installation avec revue préalable
Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.
npx -y tokrepo@latest install 06826b6b-3859-11f1-9bc6-00163e2b0d79 --target codexDry-run d'abord, confirmez les écritures, puis lancez cette commande.
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.
Questions fréquentes
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.
Sources citées (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
En lien sur TokRepo
Fil de discussion
Actifs similaires
Rathole — Lightweight High-Performance Reverse Proxy for NAT Traversal in Rust
A fast and resource-efficient reverse proxy written in Rust for exposing local services behind NATs and firewalls, serving as a lightweight alternative to frp and ngrok.
Ory Oathkeeper — Cloud Native Identity & Access Proxy
Ory Oathkeeper is an open source Identity and Access Proxy that authenticates, authorizes, and mutates incoming HTTP requests before forwarding them to upstream services, acting as a zero trust gateway.
Pomerium — Identity-Aware Zero Trust Access Proxy
Pomerium is an open source reverse proxy that provides secure, identity-aware access to internal applications without a VPN, implementing BeyondCorp-style zero trust networking with SSO integration.
Valtio — Proxy-Based State Management for React
Valtio makes React state management simple by wrapping plain JavaScript objects in a proxy, so components automatically re-render when the properties they read change — no reducers, actions, or boilerplate required.