【服务器】纯命令行Linux环境下使用代理上网
AI摘要:。
v2ray
v2ray core不区分服务端和客户端,可以直接通过配置文件完成代理上网(不支持订阅)
下面以centos7系统无root权限用户为例介绍使用方法。
- 下载并解压
v2ray-linux-64.zip
,添加文件的读写权限,建立相应软连接 - 将代理服务器的配置写成配置文件,可通过其他客户端导出config.json
- 运行v2ray:
v2ray run -c config.json
- 默认的socks代理端口为10808,http代理端口为10809
运行v2ray状态下,导入相应代理设置以使代理生效,例如对默认端口:
export ALL_PROXY="socks5://127.0.0.1:10808" export http_proxy="http://127.0.0.1:10809" export https_proxy="http://127.0.0.1:10809"
- 查看代理是否生效:
curl cip.cc
清除代理:
unset ALL_PROXY unset http_proxy unset https_proxy
clash
clash也支持命令行直接启动,默认http端口7890
运行命令:clash -f config.yml
clash已停止维护,推荐使用v2ray
本站所有原创文章版权所有,禁止转载,欢迎转发文章链接,参考请标明出处并连接到本站相应页面。所有注明的转载内容版权归原作者所有,如不慎侵权请原作者联系本站删除。