Operations 7 min read

How to Expose Your Local Services to the Internet with frp: A Step-by-Step Guide

This article explains how to set up the open‑source frp reverse‑proxy for internal network penetration, covering server and client installation, configuration files, startup commands, and a simple SpringBoot web service test, enabling remote access to services behind a NAT.

macrozheng
macrozheng
macrozheng
How to Expose Your Local Services to the Internet with frp: A Step-by-Step Guide

Project Introduction

frp is an open‑source high‑performance reverse‑proxy focused on internal network penetration, written in Go and has nearly 70k stars on GitHub. It supports TCP, UDP, HTTP, HTTPS and P2P communication, allowing internal services to be securely exposed to the public Internet via a server with a public IP.

frp consists of a client (frpc) and a server (frps). The server is deployed on a machine with a public IP, while the client runs on the internal host that needs to be accessed. After the external user reaches the frps service, frp routes the request to the appropriate internal host based on the configured ports.

Project Deployment

The following example shows a simple deployment: a Linux server runs frps, and a Windows host inside the LAN runs a web service that should be reachable from the outside.

Download Packages

Download the appropriate packages for the server and client from the frp project page.

Server Configuration

Edit the server configuration file

frps.ini

as follows:

<code>[common]
bind_port = 7000
# frp visual dashboard port
dashboard_port = 7500
dashboard_user = <em>login_user</em>
dashboard_pwd = <em>login_password</em>
vhost_http_port = 8088
</code>
bind_port

is the port that the client connects to;

dashboard_port

is optional for the management UI;

vhost_http_port

is the port used for exposing the internal web service.

Client Configuration

Edit the client configuration file

frpc.ini

on the internal Windows host:

<code>[common]
server_addr = 101.x.x.x
server_port = 7000

[web]
type = http
local_port = 8088
custom_domains = 101.x.x.x
</code>
server_addr

and

server_port

must match the server settings. The

type

field specifies an HTTP tunnel,

local_port

is the port of the local web service, and

custom_domains

can be an IP or a domain name.

Start Services

On the Linux server, start frps:

./frps -c ./frps.ini

On the Windows host, start frpc:

frpc -c frpc.ini

When the client outputs a start‑up message, the tunnel is active.

Quick Test

Create a simple SpringBoot controller that listens on port 8088:

<code>@RestController
public class FRPTestController {
    @GetMapping("/helloFrp")
    public String sayHello() {
        return "访问内网成功";
    }
}
</code>

After starting the service, access it from the Internet using

server_ip:8088/helloFrp

. The response confirms that frp is working.

Conclusion

frp provides powerful capabilities beyond the simple example shown here, including support for remote desktop (RDP) and other protocols. For more details, refer to the official repository and documentation:

Project address: https://github.com/fatedier/frp

Official documentation: https://gofrp.org/docs/

DeploymentSpringBootReverse Proxyfrpremote accessnetwork tunneling
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.