我当天在公司的防火墙后面,晚上在一个开放的互联网连接上。 我configuration了cntlm转发到我的公司代理,但是当我从一个打开的连接连接,我必须重新configuration我的代理设置。
有没有办法使cntlm备用到没有代理时使用没有可用?
# List of parent proxies to use. More proxies can be defined # one per line in format <proxy_ip>:<proxy_port> # Proxy 10.73.55.44:80 # <~~ something here to fallback to a direct connection when no proxy is available
cntlm有这个路线图,但我想我用一个简单的方法使用squid解决了这个问题:1.在ciplm的同一台机器上,在端口3129上安装squid(只需在squid.conf中将3128更改为3129)2.添加“代理本地主机:3129“到cntlm代理列表
而已。
希望这可以帮助。
此解决scheme根据您当前的IP地址重写cntlm.conf的相关部分: http : cntlm.conf
#!/bin/sh case "$2" in up|vpn-up) IP=`/sbin/ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` case $IP in 172.*) logger "setNoProxy.sh -set NoProxy for enterprise net" NoProxy="NoProxy localhost, 127.0.0.*, 10.*, 192.168.*,enterprise-intranet" ;; *) logger "setNoProxy.sh - set NoProxy for direct net" NoProxy="NoProxy *" ;; esac sudo sed "s/^NoProxy.*$/$NoProxy/g" -i /etc/cntlm.conf sudo service cntlm restart ;; esac