docker搭建frp
frp 内网穿透 官方文档链接:https://gofrp.org/docs/
1.搭建服务端
mkdir ~/frp
touch ~/frp/frps.ini
# 写入服务端frps.ini
[common]
bind_port = 7000
token = xxxxxx
vhost_http_port = 80 #客户端http映射的端口
vhost_https_port = 443 #客户端https映射的端口
dashboard_port = 7071
#dashboard_user = admin
#dashboard_pwd = frp@#admin
# start frps
docker run --restart=always --network host -d -v ~/frp/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frps
2.搭建客户端
mkdir ~/frp
touch ~/frp/frpc.ini
#写入客户端
[common]
server_addr = 127.0.0.1
server_port = 7000
#token = xxxxxxxx
admin_addr = 127.0.0.1
admin_port = 7400
#内部服务器登录
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 2233
#访问外部网站
[a.example.com]
type = http
local_port = 2233
custom_domains = a.example.com
# start frpc
docker run --restart=always --network host -d -v ~/frp/frpc.ini:/etc/frp/frpc.ini --name frpc snowdreamtech/frpc