文章目录
实现场景:
1、提升拉取Github代码速度
2、内网终端使用V2RAY访问外网
3、命令终端使用V2RAY访问外网
4、…..
准备工作
1、内网Centos7环境(流量转发端)
2、可访问外网服务器并部署V2RAY服务(服务端)
环境部署
安装V2RAY(服务端)
参考一键部署: http://mirrors.itan90.cn/v2ray
若已部署可忽略
安装V2RAY(客户端)
1 | [root@localhost ~]# yum -y install gcc gcc-c++ |
配置文件
在此处安装的V2RAY作为客户端使用,配置文件与SERVER端没有太大差别(都是用的/usr/local/etc/v2ray/config.json
配置文件),可通过直接导出Win/Mac客户端配置使用。
1 | [root@localhost ~]# vim /usr/local/etc/v2ray/config.json |
这里需要注意下json文件中的两个配置:
1、inbounds
下的port
字段为V2RAY客户端运行端口
2、inbounds
下的listen
字段为V2RAY客户端运行端口
后面Privoxy会用到。
启动服务
1 | [root@localhost ~]# systemctl enable v2ray |
安装Privoxy
安装配置
1 | [root@localhost ~]# yum -y install privoxy |
启动服务
1 | [root@localhost ~]# systemctl enable privoxy |
客户端使用
1 | # 配置代理环境(临时生效) |