Skip to content
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

SS配置客户端SwitchySharp #45

Open
kimown opened this issue Dec 30, 2015 · 2 comments
Open

SS配置客户端SwitchySharp #45

kimown opened this issue Dec 30, 2015 · 2 comments

Comments

@kimown
Copy link
Owner

kimown commented Dec 30, 2015

记录下今天的一个SS的问题。
首先描述下场景,
ubuntu系统,安装VM虚拟机,虚拟机安装WIN10系统,里面配置了一个C#版的SS客户端,使用的是桥接模式,独立分配IP地址。SS客户端链接阿里云的服务器IP,同时启用 "允许来自局域网的连接"

然后,本机ubuntu系统下的chrome浏览器配置,注意红框部分,对应WIN10的IP。

此后,访问地址,没有任何问题,server端也显示了相关的日志信息。

然后,我在自己ubuntu系统启动了SS客户端,也就是不再使用WIN10C#的流量,直接服务器端和客户端全部使用NodeJS.
config.json也是一样配置数据,

按照我的理解,只是IP地址的修改而已,

但是,没有任何响应,页面一直是在转逆时针的圈圈,本地和服务器也没有输入任何相应的日志信息。

不解???
后来看了几个博客里面的截图,发现他们那里是设置在 SOCKETS HOST里面

修改后,页面顺利打开,日志信息也树立

猜想:
因为SOCKET5位于HTTP应用层和TCP传输层中间,在本机启动客户端时,访问http://cn.bing.com/
,他会将HTTP请求转变为SOCKET数据报,然后传输到客户端内,客户端在链接阿里云服务器,实现一次请求结束。所以,转变为HTTP时会出错,页面打不开
但是当启用,允许来自局域网的连接,对于局域网的其他机器而言,它是一个HTTP代理,这样更具有通用性。

不对不对,这个理解感觉不怎么正确。

@kimown
Copy link
Owner Author

kimown commented Dec 31, 2015

场景:
http://www.sqlite.org/download.html
今天发现sqlite3的官方打不开,也ping不通,挂上SS,页面可以正常打开,于是想把官方的Documentation下载下来。
这是就需要使用wget,使用代理服务器进行下载。
但是想到1080的那个服务,chrome浏览器使用的时候是SOCKS代理,而wget进行的代理只能是HTTP类型,联想到之前的WIN10 C#的允许来自局域网的连接,这时,我发现ubuntu也需要这个相同的功能。

https://github.com/shadowsocks/shadowsocks/wiki/Convert-Shadowsocks-into-an-HTTP-proxy

Convert Shadowsocks into an HTTP proxy

First run polipo with parent proxy set to Shadowsocks:

apt-get install polipo
service polipo stop
polipo socksParentProxy=localhost:1080

Then you can play with the HTTP proxy:

http_proxy=http://localhost:8123 apt-get update

http_proxy=http://localhost:8123 curl www.google.com

http_proxy=http://localhost:8123 wget www.google.com

git config --global http.proxy 127.0.0.1:8123
git clone https://github.com/xxx/xxx.git
git xxx
git xxx
git config --global --unset-all http.proxy

不过很显然,上面的设置还是没能成功。

sudo apt-get install polipo
sudo gedit /etc/polipo/config

配置如下

logSyslog = true
logFile = /var/log/polipo/polipo.log


socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5

chunkHighMark = 50331648
objectHighMark = 16384

serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32

proxyAddress = "0.0.0.0"
proxyPort = 8123

继续执行命令

export http_proxy="http://127.0.0.1:8123/"

sudo /etc/init.d/polipo restart

日志文件在
tail -f /var/log/polipo/polipo.log
polipo设置
http://127.0.0.1:8123/
浏览器设置

注意:
service polipo start 也是可以启动polipo的.

如果发现链接不同,首先确定SS服务器启动了,然后在SS客户端启动了,然后检查polipo日志,查看日志问题
参考
http://xuhehuan.com/2119.html
http://library.zenlogic.com/ss/2014/05/10/shadowsocks-polipo-squid/

@kimown
Copy link
Owner Author

kimown commented Dec 31, 2015

wget http://sqlite.org/2015/sqlite-doc-3090200.zip -e use_proxy=yes -e http_proxy=127.0.0.1:8123

http://www.chenyudong.com/archives/wget-http-proxy-setting.html

wget --no-check-certificate https://www.google.com/
-e use_proxy=yes -e https_proxy=yourproxy.com:port ##使用https_proxy才可以哟
export http_porxy=yourproxy.com:port
export https_proxy=yourproxy.com:port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant