设置代理很简单,一句话的事儿。
set HTTP_PROXY=http://user:password@proxy.domain.com:port
比如说,我用ssr,默认地址是127.0.0.1:1080,那么应该设置为:
set HTTP_PROXY=http://127.0.0.1:1080
注意:
- 如果用ssr代理,需要 允许来自局域网的连接。
- set HTTP_PROXY 会在cmd关闭后失效,下次打开cmd需要重新设置。
那么,怎么知道我开代理成功了?
可以用 curl 命令。这个命令可以抓取html文件的数据。我们可以用这个命令去访问墙外的网站来测试。
curl www.google.com
如果返回一大堆页面数据,那就是成功了。如果什么都没有发生,那大概率是失败了。
以上。