2011-02-16 42 views
1

我经常从一个代理切换到另一个代理,并且需要频繁更改浏览器的代理设置。我试图编写一个脚本文件,根据我传递给脚本的值更改Firefox的代理。我通过了stackoverflow中的帖子,但似乎没有什么与我需要的相关。Ubuntu 10.04中通过终端进行firefox代理设置

+1

你见过狡猾的代理? http://getfoxyproxy.org/ – 2011-02-16 18:03:46

回答

-1
  1. 为什么不设置Firefox来使用系统代理设置。
  2. 编写脚本以更改您的配置文件中的代理设置。
1

我在/etc/NetworkManager/dispatcher.d/脚本,它确定要使用的当前连接的代理,然后调用:

gconf --type string --set /system/proxy/mode "manual" 
gconf --type bool --set /system/http_proxy/use_http_proxy "true" 
gconf --type string --set /system/http_proxy/host $PROXY_HOST 
gconf --type int --set /system/http_proxy/port $PROXY_PORT 
gconf --type bool --set /system/http_proxy/use_same_proxy "true" 
gconf --type bool --set /system/http_proxy/use_authentication $AUTH_REQUIRED 
gconf --type string --set /system/http_proxy/authentication_user $DOMAIN_USER 
gconf --type string --set /system/http_proxy/authentication_password $DOMAIN_PWD