通过sock5代理转http/https代理加速命令行访问站点速度的方法

13620阅读 0评论2018-02-09 missing-cn
分类:系统运维

通过sock5代理转http/https代理加速命令行访问站点速度的方法

说明

有些国外站点由于“你#¥懂……&得”等原因导致访问缓慢,甚至无法访问,特别是在使用 wget、curl、npm等shell命令和脚本的时候,由于上述原因导致安装失败,着急时挠墙的心都会有:(。

解决方法

本文介绍一种比较稳妥的方法如下:

function proxy_off(){
    unset http_proxy
    unset https_proxy
    unset ftp_proxy
    unset rsync_proxy
    echo -e "已关闭代理"
}

function proxy_on() {
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    export http_proxy=""
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
    export rsync_proxy=$http_proxy
    echo -e "已开启代理"
} 

致谢

以上所有信息均来源与互联网,本人只做了集合和整理,感谢所有为此做出贡献的人们!


上一篇:BetterJS安装及配置
下一篇:mongodb3.4增加和删除一个复制集节点