版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_38245860/article/details/82828777
首先附上 V2RAY的官方网站:https://v2ray.com/
V2RAY在linux系统下使用很简单,可以直接去Github搜索V2RAY,到release中下载不同平台的安装包。
https://github.com/v2ray/v2ray-core
V2RAY的客户端(你需要走代理的电脑)和服务端(搭建了V2RAY服务的VPS)共用一套配置文件:config.json
客户端安装:
sudo su
bash <(curl -L -s https://install.direct/go.sh)
也可以到github去搜索V2RAY,到release中下载不同平台的安装包
使用安装包本地安装:
wget https://install.direct/go.sh
sudo bash go.sh --local ./v2ray-linux-64.zip
// ./v2ray-linux-64.zip是下载到本地的安装包路径,安装过程需要root权限
安装完之后把服务端的配置文件命名为 config.json,然后拷贝到/etc/v2ray目录下并给与读写权限。
sudo cp config.json /etc/v2ray/config.json
sudo chmod 777 /etc/v2ray/config.json
然后在命令行中以service启动:
service v2ray start //启动v2ray
service v2ray status //查看v2ray状态
service v2ray stop //停止v2ray
然后可以用chrome或者Firefox的代理插件设置代理端口为127.0.0.1:1080,代理端口在config.json文件中可以找到
{
"inbound": {
"port": 1080, // SOCKS 代理端口,在浏览器中需配置代理并指向这个端口
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
}
},
此处的1080即为代理端口,然后可以安装proxychains让命令行走代理,git设置socks5代理到这个端口也是可以的!