Publish your intranet services to the public network - use FRP for network penetration
Official documentation:https://gofrp.org/en/docs
System Requirements
As it is written in Go language, the system requirements are consistent with the latest Go language requirements for systems and platforms. For details, please refer to Golang System requirements.
Download
You can download the latest version of the client and server binaries from the Release page on GitHub. All files are packaged in a zip file, which also includes a complete set of configuration parameter descriptions.
Deployment
- Unzip the downloaded package.
- Copy
frpc
to the machine where the internal network service is located. - Copy
frps
to a machine with a public IP address and place them in any directory.
Getting Started
Write the configuration file. Currently supported file formats include TOML/YAML/JSON. The old INI format is still supported but is no longer recommended.
Start the server using the following command:
./frps -c ./frps.toml
.Start the client using the following command:
./frpc -c ./frpc.toml
.If you need to run it in the background for a long time, it is recommended to combine it with other tools such as systemd,
nohup
, andsupervisor
.1
2
3
4
5# 服务端
nohup ./frps -c ./frps.toml &
# 客户端
nohup ./frpc -c ./frpc.toml &
For details on how to write a configuration file, see the content in the [Configuration File](#Configuration File) section.
For a complete explanation of the configuration options, see the content in the Official Documentation - Reference.
Configuration File
frps.toml
Deploying frps on a machine with a public IP
Deploy frps and edit the frps.toml file. Below is a simplified configuration, which sets the port for the frp server to receive client connections:
1 | bindPort = 7000 |
frpc.toml
Deploying frpc on an internal network machine that needs to be accessed
Deploy frpc and edit the frpc.toml file, assuming the public IP address of the server where frps is located is x.x.x.x. Below is an example configuration:
1 | serverAddr = "x.x.x.x" |
localIP
andlocalPort
are configured as the address and port of the internal network service that needs to be accessed from the public network.remotePort
indicates the port listened on by the frp server. Traffic to this port will be forwarded to the corresponding port of the local service.type
indicates the connection type, with common types includinghttp
andtcp
:- Common Web services and Server services use
http
connections. - Services like ssh, mysql, redis, etc., use
tcp
connections.
- Common Web services and Server services use