frp 使用

About
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

frp 其实有些功能和 ng/traefik 比较像似,唯一的区别是frp是一个内网渗透软件。而 nginx/traefik 背后的服务,对于 nginx/treafik 来说是固定的。但是 frpc 是可以主动发起对于 frps 链接建立。之后外部可以通过 frps 访问 frpc 的服务。

frps.ini

[common]

bind_addr = 0.0.0.0
bind_port = 7000

vhost_http_port = 7080
dashboard_port = 7500

token = serverToken

log_file = /home/lighthouse/frp_0.37.0_linux_amd64/log/frpc.log

frpc.ini

[common]
server_addr = 257.257.257.257
server_port = 7000
token = serverToken

[web01]
type = http
local_ip = 127.0.0.1
local_port = 8080
custom_domains = 257.257.257.257
frpc -c frpc.ini

systemd

vim /etc/systemd/system/frps.service
[Unit]
Description=Frp Server Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/home/lighthouse/frp_0.37.0_linux_amd64/frps -c /home/lighthouse/frp_0.37.0_linux_amd64/frps.ini

[Install]
WantedBy=multi-user.target

评论列表