Forward Proxy and SOCKS5 Make OpenVPN Great Again!
- 内容介绍
- 文章标签
- 相关推荐
docker-compose.yml
services:
openvpn:
build:
context: .
dockerfile: Dockerfile
# 容器名称
container_name: socks5-chain
# 重启策略
restart: unless-stopped
# 网络权限和设备
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
# 端口映射:宿主机 7080 -> 容器 1080
ports:
- "7080:1080"
# 文件挂载:将当前目录挂载到容器的 /sos
volumes:
- .:/sos
# OpenVPN 的启动参数
command: [
"--data-ciphers", "AES-128-CBC:AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305",
"--config", "/sos/client.ovpn",
"--auth-nocache",
"--socks-proxy", "host.docker.internal", "10808",
"--script-security", "2",
"--up", "/sos/up.sh",
"--down", "/sos/down.sh"
]
# 对于 Linux 系统,如果 host.docker.internal 不可用,可以取消以下注释
# extra_hosts:
# - "host.docker.internal:host-gateway"
Dockerfile
FROM alpine:latest
RUN apk add --update --no-cache openvpn dante-server
WORKDIR /sos
ENTRYPOINT ["openvpn"]
up.sh
#!/bin/sh
/etc/openvpn/up.sh
sockd -D -f /sos/sockd.conf
down.sh
#!/bin/sh
/etc/openvpn/down.sh
kill $(cat /var/run/sockd.pid)
sockd.conf
logoutput: stderr
internal: eth0 port = 1080
external: tun0
user.unprivileged: sockd
socksmethod: none
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
client.ovpn
--【壹】--:
把openvpn转成socks代理,赞。
--【贰】--:
支持f佬,干货
--【叁】--:
强啊佬,待会就试试
--【肆】--:
这个怎么用的,看着很牛逼的样子,回头我整理一下
--【伍】--:
这个好啊
--【陆】--:
先赞后收藏,尝试一下日本的家宽到底是什么样的味道
--【柒】--: 𝓕-𝓓𝓻𝓸𝓲𝓭:
client.ovpn
佬, * client.ovpn是不是没给出来呀?
--【捌】--:
佬的分享质量都很高
--【玖】--:
太强了,F佬
docker-compose.yml
services:
openvpn:
build:
context: .
dockerfile: Dockerfile
# 容器名称
container_name: socks5-chain
# 重启策略
restart: unless-stopped
# 网络权限和设备
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
# 端口映射:宿主机 7080 -> 容器 1080
ports:
- "7080:1080"
# 文件挂载:将当前目录挂载到容器的 /sos
volumes:
- .:/sos
# OpenVPN 的启动参数
command: [
"--data-ciphers", "AES-128-CBC:AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305",
"--config", "/sos/client.ovpn",
"--auth-nocache",
"--socks-proxy", "host.docker.internal", "10808",
"--script-security", "2",
"--up", "/sos/up.sh",
"--down", "/sos/down.sh"
]
# 对于 Linux 系统,如果 host.docker.internal 不可用,可以取消以下注释
# extra_hosts:
# - "host.docker.internal:host-gateway"
Dockerfile
FROM alpine:latest
RUN apk add --update --no-cache openvpn dante-server
WORKDIR /sos
ENTRYPOINT ["openvpn"]
up.sh
#!/bin/sh
/etc/openvpn/up.sh
sockd -D -f /sos/sockd.conf
down.sh
#!/bin/sh
/etc/openvpn/down.sh
kill $(cat /var/run/sockd.pid)
sockd.conf
logoutput: stderr
internal: eth0 port = 1080
external: tun0
user.unprivileged: sockd
socksmethod: none
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
}
client.ovpn
--【壹】--:
把openvpn转成socks代理,赞。
--【贰】--:
支持f佬,干货
--【叁】--:
强啊佬,待会就试试
--【肆】--:
这个怎么用的,看着很牛逼的样子,回头我整理一下
--【伍】--:
这个好啊
--【陆】--:
先赞后收藏,尝试一下日本的家宽到底是什么样的味道
--【柒】--: 𝓕-𝓓𝓻𝓸𝓲𝓭:
client.ovpn
佬, * client.ovpn是不是没给出来呀?
--【捌】--:
佬的分享质量都很高
--【玖】--:
太强了,F佬

