安装包下载地址(用docker安装不需要这个)
https://github.com/fatedier/frp/releases
官方文档
https://gofrp.org/docs/examples/vhost-http/
服务器端安装frps
先创建好存放目录
mkdir /root/frp cd /root/frp
vi frps.ini
生成配置文件frps.ini内容如下,请根据实际情况改成你自己的
[common] bind_port = 17000 token = 12122121212121212112565656 vhost_http_port = 10080 vhost_https_port = 10443 dashboard_port = 17500 dashboard_user = admin dashboard_pwd = admin tcp_mux = true max_pool_count = 10
vi docker-compose.yml
生成一个 docker-compose.yml文件内容如下,请根据实际情况改成你自己的
version: '3' services: frps: image: snowdreamtech/frps:latest ports: - "20:17000" #通讯端口 - "27500:17500" #web管理 - "10022:10022" #用于ssh连接 - "10080:10080" #http - "10443:10443" #https # 更多端口根据实际需求增加 # 左边为主机 右边为docker volumes: - ./frps.ini:/etc/frp/frps.ini container_name: frps restart: unless-stopped
然后就可以运行了
docker-compose up -d
如果要关闭就这样
docker-compose down
—————————————–我是frps和frpc的分隔线—————————————–
客户端安装 frpc
先创建好存放目录
mkdir /root/frp cd /root/frp
vi frpc.ini
[common] server_addr = server.abc.com server_port = 20 token = 12122121212121212112565656 [bot-grid] type = http local_ip = 127.0.0.1 local_port = 8090 custom_domains = xxx.abc.com use_encryption = true use_compression = true [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 10022 use_encryption = true use_compression = true
vi docker-compose.yml
version: '3' services: frpc: image: cloverzrg/frpc-docker volumes: - ./frpc.ini:/conf/frpc.ini container_name: frpc network_mode: host restart: unless-stopped
然后就可以运行了
docker-compose up -d
完结收工,由于使用了 restart: unless-stopped,重新开机后,它会自动启动