所需服务器 2台
一台具有国外公网ip
一台具有国内 ip 内网外网都可以
外公网ip服务器配置如下
cat docker-compose.yaml
version: "2"
services:
frps:
image: alpine:latest
hostname: frps
restart: always
container_name: frps
privileged: true
user: root
command: [ "/frp/frps","-c","/frp/frps.ini" ]
volumes:
- ./frp:/frp
- /etc/localtime:/etc/localtime
ports:
- "60000:60000"
frpc:
image: alpine:latest
hostname: frpc
restart: always
container_name: frpc
privileged: true
user: root
command: [ "/frp/frpc","-c","/frp/frpc.ini" ]
volumes:
- ./frp:/frp
- /etc/localtime:/etc/localtime
cat frp/frps.ini
[common]
bind_port = 60000
tls_enable = true
cat frp/frpc.ini
[common]
server_addr = frps
server_port = 60000
[proxy]
type = tcp
remote_port = 104
plugin = http_proxy
[stcp_proxy]
type = stcp
sk = abcdefg
local_ip = frps
local_port = 104
重点 !!! 在内网 或者 国内IP服务器上 搭建frpc的stcp客户端文章来源:https://www.toymoban.com/news/detail-729649.html
cat docker-compose.yml
version: "2"
services:
frpc-test:
image: centos:8
hostname: frpc-test
restart: always
container_name: frpc-test
mem_limit: 2G
memswap_limit: 0M
mem_reservation: 256M
privileged: true
user: root
command: [ "/frp/frpc","-c","/frp/frpc-test.ini" ]
volumes:
- ./frp:/frp
networks:
default:
ipv4_address: "10.0.0.28"
ports:
- 26080:80
cat frp/frpc-test.ini
[common]
server_addr = 服务器IP
server_port = 60000
[stcp_proxy_visitor]
type = stcp
# stcp 的访问者
role = visitor
# 要访问的 stcp 代理的名字
server_name = stcp_proxy
sk = abcdefg
# 绑定本地端口用于访问 SSH 服务
bind_addr = 0.0.0.0
bind_port = 80
之后用刚搭建好的客户端服务器:16004访问 代理服务器文章来源地址https://www.toymoban.com/news/detail-729649.html
到了这里,关于docker frp 搭建 http + stcp 代理的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!