Skip to content

v2rayA+docker:支持全局透明代理的V2Ray Linux客户端

参考

  • https://telegra.ph/v2rayA%E6%94%AF%E6%8C%81%E5%85%A8%E5%B1%80%E9%80%8F%E6%98%8E%E4%BB%A3%E7%90%86%E7%9A%84V2Ray-Linux%E5%AE%A2%E6%88%B7%E7%AB%AF—%E8%8D%92%E5%B2%9B-04-16-3
  • https://github.com/v2rayA/v2rayA/wiki/Usage

Problem

如果在国内机器上设置好透明代理,既可以方便机器本身的翻墙上网;又能够提供给其他机器的翻墙代理。

Solution

mkdir -p /data/v2raya && cd /data/v2raya
docker run -d \
  --restart=always \
  --privileged \
  --network=host \
  --name v2raya \
  -v /etc/resolv.conf:/etc/resolv.conf \
  -v /data/v2raya:/etc/v2raya \
  mzz2017/v2raya
docker logs -f v2raya

服务器端通过Web配置

客户端

Annex:Mac上的服务器配置

If you’re using MacOSX or other environment does not support host mode, you can not use “transparent proxy” in this case, docker command will be slightly different: With V2RayA service running, visit the port 2017 to enjoy it (such as http://localhost:2017).

# run v2raya
mkdir -p ~/data/v2raya && cd ~/data/v2raya
docker run -d \
	-p 2017:2017 \
	-p 20170-20172:20170-20172 \
	--restart=always \
	--name v2raya \
	-v $(pwd):/etc/v2raya \
	mzz2017/v2raya

Leave a Reply

Your email address will not be published.