如何在ubuntu12上设置系统范围的代理,以便我们可以在代码中调用webservice

时间:2023-01-31 20:14:25

I am new to ubuntu, now i use eclipse 3.7 on ubuntu 12; In the code i need to call a webservice, but my work environment works behind a proxy, i need to find a way to set system-wide proxy.

我是ubuntu的新手,现在我在ubuntu 12上使用eclipse 3.7;在代码我需要调用webservice,但我的工作环境在代理后面工作,我需要找到一种方法来设置系统范围的代理。

Already the proxy in ubuntu system setting and use firefox with option "use system proxy", it is able to call that service, but to call it from code, it failed.

已经是ubuntu系统设置中的代理并使用选项“使用系统代理”的firefox,它可以调用该服务,但是从代码中调用它,它失败了。

Also i have tried to edit the files individually like /etc/environment, /etc/bash.bashrc to set the proxy but still not work.

此外,我试图单独编辑文件,如/ etc / environment,/ etc / bash.bashrc设置代理,但仍然无法正常工作。

Have tried to use the tool provixy, but i am not so sure how to configure it(i do not set the listen-address, as searched on google it will listen all the http request with this setting).

试图使用工具provixy,但我不太确定如何配置它(我没有设置listen-address,因为在google上搜索它将使用此设置监听所有http请求)。

Any one knows how to set the system-wide proxy?(i'd rather not to set proxy on eclipse or code). Any comment will be appreciated!

任何人都知道如何设置系统范围的代理?(我宁愿不在eclipse或代码上设置代理)。任何评论将不胜感激!

2 个解决方案

#1


0  

You can do it in gnome, in go to System--->Preferences--->Network Proxy.

您可以在gnome中进行,转到System ---> Preferences ---> Network Proxy。

If you need the proxy in the console to, edit your bashrc, just add these configuration:

如果您需要在控制台中使用代理来编辑您的bashrc,只需添加以下配置:

export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/

#2


0  

Already use privoxy and iptables to resolve this

已经使用privoxy和iptables来解决这个问题

#1


0  

You can do it in gnome, in go to System--->Preferences--->Network Proxy.

您可以在gnome中进行,转到System ---> Preferences ---> Network Proxy。

If you need the proxy in the console to, edit your bashrc, just add these configuration:

如果您需要在控制台中使用代理来编辑您的bashrc,只需添加以下配置:

export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/

#2


0  

Already use privoxy and iptables to resolve this

已经使用privoxy和iptables来解决这个问题