我想通过设置HTTP_PROXY和HTTPS_PROXY方法实现代理,格式如下
$ export HTTP_PROXY="http[socks5]://user:pass@server_address:port/"
$ export HTTPS_PROXY="http[socks5]://user:pass@server_address:port/"
昨天我买了一台阿里云的服务器,经过SSH -D user@server然后通过Chrome下的proxy插件可以实现翻墙。现在我想让用设置环境变量
的方式代理实现终端下也能访问Goole等网站的页面,请问我应该怎样在我的阿里云服务器上面配置呢?
附录:
自己在Python爬虫
里面通过下面的方式利用Shadowsocks已经可以爬取墙外的网站了,现在主要想在终端下使用wget, youtube-dl等命令翻墙。
proxy_handler = SocksiPyHandler(socks.SOCKS5, '127.0.0.1', 1080)
For your title, if you want to achieve the purpose of global proxy , you can read the
iptables
part of this articlehttps://linuxaria.com/article...
I excerpted it
iptables
The configuration is as follows:This configuration forwards all
TCP
connections except local LAN connections to port 31338. Obviously you should use proxy software to monitor this port in advance. Of course, it can also be any other designated proxy listening port.PS: Global proxy is actually very impractical. It’s better to separate application proxies. As for what you said, just use
wget
这些命令也使用代理的话, 用之前临时export
下env
and that’ll be fineFor example, my proxy is thrown under
192.168.100.100
上面, 端口1080
, 我要wget
YouTube:Easy and enjoyable, of course some applications may not support it
Socks5
协议, 直接搜"socks5 to http"一堆答案, 我一般用privoxy
Regarding proxy, we recommend two tools, proxychains and privoxy. Like wget and youtube-dl, you can specify the proxy in the parameters, so if you have an ss server, just set up the ss proxy locally. I think it's better to use proxies for applications rather than creating system-level global proxies.