Ask Your Question
2

How to set a SOCKS proxy through the command line

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

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
3

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

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

Eg.

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

Comments

More info on tsocks: You configure tsocks via the file /etc/tsocks.conf, for example I’ve set the following four variables: local = 192.168.1.0/255.255.255.0 # 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 http://bassdrive.com/bassdrive.m3u.

erik gravatar imageerik ( 2016-12-27 17:57:16 -0600 )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

Stats

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

Seen: 10,131 times

Last updated: Dec 27 '16