无法正常启动Shadowsocks,启动后报错如下:
[2017-08-13 10:26:03] Shadowsocks started
[2017-08-13 10:26:03] [E] System.Exception: InternetSetOption: 12178
在 Shadowsocks.Util.SystemProxy.WinINet.SetIEProxy(Boolean enable, Boolean global, String proxyServer, String pacURL)
在 Shadowsocks.Controller.SystemProxy.Update(Configuration config, Boolean forceDisable)
在 Shadowsocks.Controller.ShadowsocksController.UpdateSystemProxy()
在 Shadowsocks.Controller.ShadowsocksController.Reload()
在 Shadowsocks.Program.Main()
求解决~~
Found the root cause for me is that "WinHTTP Web Proxy Auto-Discovery Service" is not enabled.
How to resolve:
Run->services.msc-> Check if "WinHTTP Web Proxy Auto-Discovery Service" is disabled? -> enable it.
I believe these issues are potentially relates to this issue:
https://github.com/shadowsocks/shadowsocks-windows/issues/1125
https://github.com/shadowsocks/shadowsocks-windows/issues/1193
https://github.com/shadowsocks/shadowsocks-windows/issues/1229
Shadowsocks for Windows NOT need this services.
I guess is some hijacking or coincidence issue.
Yes, it's highly related to the service because sysproxy.exe is based on wininet which requires that service.
Specificly the 12178 error code means ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR which relates to the service.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx
odd,On my system,I Stop/Disabled WinHttpAutoProxySvc ,And shadowsocks still can work.
It won't affect shadowsocks' socks proxy.
You can still use the browsers' proxy settings to use it.
It only affects the ability to toggle global proxy.
Interesting...
请升级到最新版本
我看到你的日志里有记录
Shadowsocks.Util.SystemProxy.WinINet.SetIEProxy(
WinINet已在2016年年底被Sysproxy取代
5c5f753
@celeron533
我同意我们应该使用最新的版本。
但是即使在最新版本上也会有一样的问题,区别只是这个异常在最新版本上是由sysproxy 抛出的。
我之前在:
https://github.com/shadowsocks/shadowsocks-windows/issues/1125#issuecomment-299361215
里面有追溯到出问题的行(https://github.com/Noisyfox/sysproxy/blob/master/sysproxy/main.c#L85)
Windows的代理设置机制有可能在Windows 10 1703以后的版本上有改变。
现在会依赖于“WinHTTP Web Proxy Auto-Discovery Service”的服务。
所以一个可能更好的做法是通过sysproxy或是shadowsocks去检测这一服务是否启动,或者至少在sysproxy抛出12178的错误时在异常信息中写明原因以便用户自己去启动这一服务。
我实在是不太会写c所以没法去改sysproxy。
我倒是可以做一个.Net的PR来改善这个问题,这样就得在SS-win中处理这个异常。
但是我不知道这样做是不是合适:)
所以一个可能更好的做法是通过sysproxy或是shadowsocks去检测这一服务是否启动,或者至少在sysproxy抛出12178的错误时在异常信息中写明原因以便用户自己去启动这一服务。
我实在是不太会写c所以没法去改sysproxy。
我倒是可以做一个.Net的PR来改善这个问题,这样就得在SS-win中处理这个异常。
wininet的编译目标必须和运行平台一致,所以有了x86和x64的区别
https://github.com/shadowsocks/shadowsocks-windows/issues/1662#issuecomment-363647836
@celeron533
我同意我们应该使用最新的版本。
但是即使在最新版本上也会有一样的问题,区别只是这个异常在最新版本上是由sysproxy 抛出的。
我之前在:
#1125 (comment)
里面有追溯到出问题的行(https://github.com/Noisyfox/sysproxy/blob/master/sysproxy/main.c#L85)Windows的代理设置机制有可能在Windows 10 1703以后的版本上有改变。
现在会依赖于“WinHTTP Web Proxy Auto-Discovery Service”的服务。所以一个可能更好的做法是通过sysproxy或是shadowsocks去检测这一服务是否启动,或者至少在sysproxy抛出12178的错误时在异常信息中写明原因以便用户自己去启动这一服务。
我实在是不太会写c所以没法去改sysproxy。
我倒是可以做一个.Net的PR来改善这个问题,这样就得在SS-win中处理这个异常。
但是我不知道这样做是不是合适:)
的确如此,感谢 @ReVanTis 提供思路,我是从LTSB 2016升级到 LTSC 2019后便报这个错误,由于WinHTTP Web Proxy Auto-Discovery Service服务我一般优化时都会关闭掉,的确这次LTSC2019中,该服务变为不能直接关闭而需要通过注册表关闭我还蛮奇怪的,原来还有这个坑,在此感谢!
Most helpful comment
It won't affect shadowsocks' socks proxy.
You can still use the browsers' proxy settings to use it.
It only affects the ability to toggle global proxy.