Ask Your Question

How to set a SOCKS proxy through the command line

asked 2016-12-26 21:03:21 -0500

Ninj0r gravatar image

I know how to set a SOCKS proxy through GNOME by doing: Network -> Network Proxy -> SOCKS host

But what is/are the equivalent command line command(s)?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-12-27 08:37:22 -0500

On the command line you have the environment variables http_proxy, https_proxy, ftp_proxy, ... which can hold the URL of your proxy.


export http_proxy="socks5://localhost:9050"
export https_proxy=$http_proxy

There also seems to be a wrapper calles tsocks which also can be used.

A more comprehensive overview of the Proxy configuration can be found here.

edit flag offensive delete link more


More info on tsocks: You configure tsocks via the file /etc/tsocks.conf, for example I’ve set the following four variables: local = # do not use proxy for my local net, server = localhost # in my case the proxy-server runs on my localhost, server_type = 5 # I want to use socks version 5, server_port = 5000 # my proxy uses port 5000. Then I start my programs with tsocks like this: tsocks firefox or tsocks mplayer -playlist

erik gravatar imageerik ( 2016-12-27 17:57:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-12-26 21:03:21 -0500

Seen: 13,739 times

Last updated: Dec 27 '16