openwrt 上有什么好办法解决 http 代理的自动认证

2014-12-26 09:49:33 +08:00
 wilhexm
在wndr4300上折腾透明翻墙。刷了openwrt,并将前置代理转换为了http代理。但代理需要用户名密码认证,在移动设备上使用不方便。二级代理换了好几个都不行,Polipo,redsocks,privoxy,tinyproxy都试过了,没有成功。请问有没有什么办法可以自动完成代理的认证?好像cow可以实现,但是我4300是mips的,cow不支持,请问有没有什么办法可以自动完成代理的认证?
1446 次点击
所在节点    问与答
11 条回复
cattyhouse
2014-12-26 09:59:07 +08:00
发问前还好看文档,比如polipo
Next: SOCKS parent proxies, Previous: Parent proxies, Up: Parent proxies [Contents][Index]

3.10.1 HTTP parent proxies

The variable parentProxy specifies the hostname and port number of an HTTP parent proxy; it should have the form ‘host:port’.

If the parent proxy requires authorisation, the username and password should be specified in the variable parentAuthCredentials in the form ‘username:password’. Only Basic authentication is supported, which is vulnerable to replay attacks.

The main application of the parent proxy support is to cross firewalls. Given a machine, say trurl, with unrestricted access to the web, the following evades a firewall by using an encrypted compressed ssh link:

$ ssh -f -C -L 8124:localhost:8123 trurl polipo
$ polipo parentProxy=localhost:8124
cattyhouse
2014-12-26 10:02:29 +08:00
Openwrt 配置 polipo修改 /etc/config/polipo 才有效,具体模仿那个配置文件添加相应的option,应该在 General那个下面加。
yyai3
2014-12-26 10:26:17 +08:00
cntlm
wilhexm
2014-12-26 11:08:36 +08:00
@cattyhouse 经你提示,重新折腾了一下polipo,终于成功了,是配置加载的问题。暂时用 polipo -c '/etc/polipo/config' 代理成功。接下来折腾pac分发的问题。。。非常感谢
cattyhouse
2014-12-26 15:34:39 +08:00
@wilhexm 你这么做固然可以。但更好的方法是编辑并照葫芦画瓢的配置 /etc/config/polipo, 然后用 /etc/init.d/polipo 来控制和加入开机启动。
wilhexm
2014-12-26 15:45:01 +08:00
@cattyhouse 谢谢,我回头再重新刷一遍从头配置一遍看看。另外我打算用WPAD来分发pac文件。我把pac文件上传到了/www,在IE中设置代理http://192.168.1.1/proxy.pac时可以成功自动代理。但是在config dnsmasq下面添加 list dhcp_option '252,http://127.0.0.1/proxy.pac' 并重启 dnsmasq,怎么都不行(后者的pac文件代理地址我已经从192.168.1.1改成了127.0.0.1)。请问这是哪方面的原因?或者有更高效准确的做法吗?
cattyhouse
2014-12-26 15:49:54 +08:00
@wilhexm 没玩过wpad,但我觉得不要用127.0.0.1这种作为pac地址,pac内也不要用这个地址,这个地址在任何地方被读取都代表本机地址,你应该写路由器ip。
wilhexm
2014-12-26 16:09:54 +08:00
@cattyhouse 因为路由器内polipo接前置代理的地址是127.0.0.1,我以为这里也要如此,看来我理解有误。不过更改后还是不行,我搜索一下看看有没有其他方案。
cattyhouse
2014-12-26 16:25:46 +08:00
polipo默认只允许本机用,你需要设置allowclients 还是allowlist? 请参考配置照葫芦画瓢!照葫芦画瓢很重要!!!这叫举一反三!!!
cattyhouse
2014-12-26 16:33:19 +08:00
类似这个

allowedClients = 127.0.0.1, 192.168.200.0/24
wilhexm
2014-12-26 21:21:39 +08:00
@cattyhouse 最后搜到别人的文章才发现可能不是这个问题,而是WPAD协议本身的问题,windows下的IE必须勾选“自动监测设置”,而Android压根不支持这个。改用一下dnsmasq的ipset来试试。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/156786

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX