Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to bypass the proxy for all addresses that are local network addresses. Such as http://test/ and http://mymachine/ and http://hismachine/

Is there an easy way to do that?

share|improve this question
    
easier then a gui, i would try the command line using gconftool. –  nelaar May 12 '11 at 12:03
    
have a look at this file ~/.conf/system/http-proxy/%gconf.xml. You would still need to update the system some how. Still looking into that. –  nelaar May 12 '11 at 12:06
add comment

4 Answers 4

How are proxy settings set in the Ubuntu gnome environment.

These methods are not full proof and can break the configuration of the system. Making the network behave in an undesired way. Only do this if you understand how it affects different parts of the system.

You can set some of the proxy settings here. But for ignore hosts you will need to set that else where.

$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
http_proxy="http://192.168.1.250:8080/"
ftp_proxy="ftp://192.168.1.250:8080/"
https_proxy="https://192.168.1.250:8080/"

The env command is related to the above file but many programs and system utilities make changes to the environment. More info can be found here, read this before making changes. https://help.ubuntu.com/community/EnvironmentVariables

$ env | grep proxy
http_proxy=http://192.168.1.250:8080/
ftp_proxy=ftp://192.168.1.250:8080/
all_proxy=socks://192.168.1.250:8080/
https_proxy=https://192.168.1.250:8080/
no_proxy=localhost,127.0.0.0/8,127.0.1.1,127.0.1.1*,local.home

simply change this by

no_proxy=myhost_to_ignore,$no_proxy
export no_proxy

We need to add back the list of previously set no_proxy hence we add it back at the end of the line. This is only applicable to the terminal session that the command is run in and will not apply system wide read the community help documentation to make permanent changes.

To make changes in the gnome environment you can use the gconftool. Read the following guide before attempting to make changes.
http://library.gnome.org/admin/system-admin-guide/stable/gconf-0.html.en

Here are instructions on changing proxy settings using the gconftool
http://library.gnome.org/admin/system-admin-guide/stable/gconf-8.html.en#gconf-10

$ gconftool --recursive-list /system/http_proxy 
use_authentication = false
authentication_password = 
authentication_user = 
ignore_hosts =[localhost,127.0.0.0/8,127.0.1.1]
use_http_proxy = true
port = 8080
use_same_proxy = true
host = 192.168.1.250

The following file ~/.conf/system/http-proxy/%gconf.xml. Will be changed by the next command. I am unsure how to set a list type with gconftool. MY attempts ended up removing all the previous settings.

I am sure their is a better way to do this!!
Safe way to do it. get the current contents of the /system/http_proxy/ignore_hosts

gconftool -g  /system/http_proxy/ignore_hosts  

Next copy its contents into the next command and add the host you want to add.

gconftool  --type list --list-type string  -s /system/http_proxy/ignore_hosts '[localhost,127.0.0.0/8,myhost]'
share|improve this answer
add comment

Assuming you're using the default Ubuntu Gnome desktop: You need to add your local host addresses to the ignore list in the gnome proxy settings:

alt text

share|improve this answer
1  
I know about this, what I'm wondering is there anyway to add all addresses that do not have a domain... such as intranet or sharepoint to this site implicitly. It would really suck to have to add thousands of ignore entries. –  spoon16 Nov 4 '10 at 4:38
1  
That wasn't your question though. You asked how to ignore localhost addresses, this is how you do that. You should use the *.local address for all your localhost services anyway, that will make it easier to specify in this ignore list. But I don't know why you would have thousands of localhost services, could you explain? –  Martin Owens -doctormo- Nov 4 '10 at 4:46
    
Using either .local when using mDNS/Avahi or some other LAN domain when using DNS (including when using something like Active Directory) is a good idea indeed. –  JanC Nov 4 '10 at 11:44
    
Owens, my question was how to ignore ALL local host addresses. I reread it, I think the wording is clear :) I work at a very large organization, internal resources are not referred to locally with any sort of domain identifer in hrefs and there are literally thousands of domain local resources on the network. –  spoon16 Nov 4 '10 at 17:29
    
Then you mean 'local network' not 'local host'. Although I maintain that a properly configured network would have only a handful of common domains. Your network seems misconfigured, but if you can't do anything about that now, then you could make a script and download the local dns repository parse it and put them all in ignores which are all stored in gconf. I don't think there is any existing way to do that, although perhaps a feature bug would be a good place to start from. –  Martin Owens -doctormo- Nov 5 '10 at 8:21
add comment

Our IT department was able to provide an auto configuration URL that includes all of the appropriate ignore patterns and hosts for our domain. This is definitely the easiest way to go if it is available to you.

share|improve this answer
add comment

This information is highly outdated so you should probably follow this thread: Proxy exceptions in 12.04 LTS

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.