Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm coding a small application that connects to the Internet and retrieves information from my server using bsd socket. I looked at where the proxy settings are stored under Linux but i couldn't the file containing this information.

I just want to find that file, so I can read the proxy settings from it and use these settings in my application.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

They're in the $http_proxy, $https_proxy and $ftp_proxy environment variables. Also, $no_proxy contains a comma-separated list of host patterns for which no proxy is used. For example:

http_proxy=http://proxy.example.com:3128/
no_proxy=localhost,127.0.0.1,*.example.com
share|improve this answer
    
thanks, does this work on all linux desktops? or just gnome? –  killercode Oct 21 '11 at 6:06
    
It's a de facto *nix standard. –  Ignacio Vazquez-Abrams Oct 21 '11 at 6:08
    
ok, thanks again –  killercode Oct 21 '11 at 6:09
    
@killercode There are applications that have their own settings, especially browsers that have a Javascript interpreter and support PAC files. But the default expectation is that a unix application will support at least these environment variables, and it's reasonable to tell your users to ensure the environment variables are set. –  Gilles Oct 21 '11 at 16:17
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.