New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows终端命令行下如何使用代理? #1489

Closed
anlexN opened this Issue Oct 28, 2017 · 27 comments

Comments

Projects
None yet
@anlexN

anlexN commented Oct 28, 2017

代理已经成功,浏览器也能访问被限制的网站,就是终端不能!我要网上相关资料:set http_proxy=127.0.0.1:1080, 还是无法设置!!!

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Oct 28, 2017

set HTTP_PROXY=http://user:password@proxy.domain.com:port

example:

set HTTP_PROXY=http://192.168.1.100:8080

https://www.calazan.com/how-to-set-the-proxy-settings-in-windows-via-command-line/

@anlexN

This comment has been minimized.

anlexN commented Oct 28, 2017

still don't ! please help me, @chenshaoju .

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Oct 28, 2017

我不知道你用的是什么,但是在我这儿是可以工作的。

请确保你使用了正确的HTTP代理地址(不是SOCKS5),以及等于号后面的 http:// 。

image

@anlexN

This comment has been minimized.

anlexN commented Oct 29, 2017

@chenshaoju

  • 我用的就是你们的软件shadowsocks-windows4.0.6,请问您做了什么设置?进行如下图的设置?但是我还是不成功,ping google.com不通
  • 您ping google.com试一下,成功吗?

我确定已经勾选系统代理,已经勾选全局代理,浏览器已经能访问被屏蔽的网站

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Oct 29, 2017

0.SS不是我开发的。

1.我是指你命令提示符下用的是什么东西。

2.Ping是ICMP协议,不是TCP/UDP协议,Ping不走,也无法走代理。

3.如果你坚持要能Ping通才行,请考虑常规VPN(PPTP/L2PT/IPSec等)。

@anlexN

This comment has been minimized.

anlexN commented Oct 29, 2017

@chenshaoju
http代理要另外设置吗?10801端口,你自己设置的?我要在终端下使用google cloud相关命令

@ddcatgg

This comment has been minimized.

ddcatgg commented Oct 29, 2017

@anlexN shadowsocks客户端不是有一个代理模式的选择吗?选全局代理模式试试。

Windows任务栏右下角托盘图标->右键菜单->系统代理模式->全局模式

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Oct 29, 2017

HTTP代理就是你本机的SS的代理的端口。在SS设置服务器设置界面右下角的那个端口号。

@anlexN

This comment has been minimized.

anlexN commented Oct 29, 2017

目前,我总结:不懂ping使用的协议。谢谢大家,敬礼!

@ddcatgg

This comment has been minimized.

ddcatgg commented Oct 29, 2017

@chenshaoju 不过说实话我也是刚知道右下角那个端口号是Shadowsocks提供的HTTP代理端口,一直以为Shadowsocks是提供SOCKS5代理服务的,理所当然地认为那是本地级联端口呢。软件界面就那么惜墨如金,不愿写清楚那是 HTTP代理端口……

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Oct 29, 2017

@ddcatgg ¯_(ツ)_/¯

@XingdaLee

This comment has been minimized.

XingdaLee commented Oct 30, 2017

有的用就不错了!什么惜墨如金,自己搞不清楚 ,哪来的抱怨。

@ddcatgg

This comment has been minimized.

ddcatgg commented Oct 30, 2017

@XingdaLee 改掉这个问题可以使 Shadowsocks 变得更好,不是么?

@anlexN

This comment has been minimized.

anlexN commented Oct 30, 2017

对。@chenshaoju, 你收徒弟吗?我想跟你学网络技术。我一个人的力量太渺小了,生命还是那么有限…

@jinliming2

This comment has been minimized.

Contributor

jinliming2 commented Nov 5, 2017

@ddcatgg SS提供的端口貌似是既可以用于HTTP代理,又可以用于SOCKS 5代理。

@jinliming2

This comment has been minimized.

Contributor

jinliming2 commented Nov 5, 2017

据我所知,cmd是不需要设置代理的啊,cmd内置的命令貌似都没有联网的。
而其他诸如ping、nslookup之类的都是系统目录下的exe文件,因为设置了path环境变量,所以可以直接输入文件名调用(也可以输入ping.exe)。
而这些exe的话一般都是走系统代理的(就是在IE的选项里设置的那个代理,Windows 10在网络设置里也有),当然,也有的exe是不走系统代理的(一般都提供了代理设置的配置项,因不同软件而异,比如 Git,就需要添加代理的配置项http.proxyhttps.proxy)。
如果是走系统代理的话,右下角图标选择“启用系统代理”就可以了(一般PAC模式都行,部分可以试试全局模式)。

如果exe不是走系统代理的话,就要使用VPN等全局的工具了,这样系统所有的流量都会走代理。
没有VPN的话,使用一个叫SSTap的软件也可以将ss的代理转为网卡级别的全局代理(利用的是OpenVPN提供的虚拟网络适配器):https://www.sockscap64.com/sstap/ 注意:这个软件是免费的,但并不开源(我没有找到源代码),所以请谨慎使用!

顺便:http_proxyhttps_proxy都是Linux下的代理设置变量。

@ddcatgg

This comment has been minimized.

ddcatgg commented Nov 6, 2017

@jinliming2 不行的,那端口不支持SOCKS5,我试了。

@celeron533

This comment has been minimized.

Collaborator

celeron533 commented Dec 15, 2017

命令行只是使用环境,一般而言是否走http代理由运行的程序自己决定(采用系统代理 或 程序自己指定代理
或 完全就没有代理这个设计只能直连)。如果要整个cmd环境(如让ping也走代理),用楼上推荐的sstap之类的软件做到虚拟网卡级别的连接。

@celeron533 celeron533 closed this Dec 15, 2017

@zcdll

This comment has been minimized.

zcdll commented Jan 27, 2018

PowerShell 中需要按照这样配置 PowerShell Set-Proxy, Clear-proxy

@LMerCy

This comment has been minimized.

LMerCy commented Feb 8, 2018

你好,请问你解决了吗?我也是要用google cloud的api,但是gcloud init的时候没法连接

@GuohuaHu

This comment has been minimized.

GuohuaHu commented Apr 12, 2018

@LMerCy
我也是一样,使用earthengine的Initialize()无法连接

@erDaren

This comment has been minimized.

erDaren commented Jul 28, 2018

我尝试了这样是可以的

set http_proxy=127.0.0.1:1080
set https_proxy=127.0.0.1:1080

你可能忘了加https_proxy

@ynzheng

This comment has been minimized.

ynzheng commented Oct 21, 2018

image

直接使用这个就可以

@csysl

This comment has been minimized.

csysl commented Oct 23, 2018

image

直接使用这个就可以

请问这个是什么软件

@AnyWAT

This comment has been minimized.

AnyWAT commented Oct 29, 2018

貌似SSR的“选项设置”

@Dkaishu

This comment has been minimized.

Dkaishu commented Nov 22, 2018

勾选【允许来自局域网的连接】
并执行

set http_proxy=127.0.0.1:1080
set https_proxy=127.0.0.1:1080

其中1080是指ss编辑服务器页面右下角的【代理端口】

@chenshaoju

This comment has been minimized.

Contributor

chenshaoju commented Nov 22, 2018

如果是本机自己用的话,127.0.0.1 没有必要启用“允许来自局域网的连接“。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment