Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My Macbook pro use a proxy server to connect to Internet, and using safari ,I can visit the website. Now I'm installing Macports, and it needs to connect to the internet, but the terminal just can't access Internet... I tried to ping www.google.com or any other sites, all failed. so I guess It's the problem about using proxy server. What should I do to let my terminal conneted with internet?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Most applications that you run from the command line do not use Mac's system proxy. You need to set the variable http_proxy to the proxy. This should let you connect to the internet from applications on the command line. (Note: Some application have there own proxy settings which you might have to look up).

So you could put in ~/.bashrc (or whatever shell config file you are using) the following command.

export http_proxy="<proxy>"

where <proxy> is the address of the proxy.

share|improve this answer
    
It would likely help, especially with some wonky proxy urls, for the proxy url to my quoted: export http_proxy="<proxy>" –  demure May 23 '13 at 5:02
    
Thanks a lot! It's very helpful but still not sovle my problem, I add these lines to my ~/.bash_profile also the ~/.bashrc <br/> export http_proxy=http://192.168.4.12:8080/ export https_proxy=http://192.168.4.12:8080 and run source ./bash_profile but when I want to ping the website, It still failed... –  linkbreaker May 23 '13 at 5:56
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.