Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Monday, November 28, 2011

Run internet required commands behind a proxy server in Linux

Most of the time I need to run a terminal behind a proxy server at my office to run a batch job, and I failed to run it because I don't know how to add proxy server in the terminal. But, now, I just found the command to add a proxy server in Linux. It's very simple just only one line :)

Open terminl and type this command
# Changing username, password, proxyname, and port to be yours.
export http_proxy="http://username:password@proxyname:port"
# After that you can test to run behind your proxy server
# , simply as following.
wget http://www.google.com
# If the connection is successful, then you will get the 
# file from this Google page.

To remove the proxy server from your network run the following command:
# Just delete a proxy sever variable using unset 
unset http_proxy
# Or set http_proxy to blank
export http_proxy=""

The example above is how bind a proxy server in HTTP protocol.
For the other protocols, e.g. FTP, ... so on. Try to find its variable for binding with a proxy server.
Another protocol that I know is FTP.
FTP => ftp_proxy
If you want to remove it, do the same as the example above.

Good luck ^^.

No comments:

Post a Comment