socks client on linux – LinuxQuestions.org
> Linux Forums
> Linux – Networking
socks client on linux
Linux – Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to Visit the following links:
Site Howto |
Site FAQ |
Register NowIf you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Search this Thread
11-29-2011, 02:15 PM
Registered: Jun 2006
I have access to a socks server, and I use it by Proxifier software in windows.
I want to know is there any alternative for Proxifier in linux?
11-29-2011, 09:48 PM
Registered: Jan 2009
Distribution: Mostly Debian and CentOS
Posts: 6, 206
I’ve used tsocks for years and have been quite happy with it.
11-29-2011, 11:23 PM
I want to pass my browser(firefox or chrome) traffic through a socks server.
How should I configure tsocks and browser to achieve this?
11-29-2011, 11:48 PM
For browsers you shouldn’t need to use tsocks: instead most browsers have built in proxy support. If you use a desktop environment 9eg gnome, kde, etc) then chrome/chromium will use whatever proxy is set there. If you don’t use a desktop environment you can write a file and start your browser with the –proxy-pac-url option.
For example, I start my browser as follows:
Where $HOME/ looks something like:
function FindProxyForURL(url, host)
return “SOCKS 192. 168. 1. 123:8765”;}
where the IP and port correspond to the location of your socks proxy.
IIRC firefox proxy can be set using the configuration menues, but I think you may also need to dig a little deeper to make its DNS calls also use the proxy.
If you want to use tsocks for something, you configure it in /etc/ an can use it with random programs in the following fashion:
11-30-2011, 08:05 AM
Registered: May 2011
With my tun2socks software it is possible to forward all TCP through SOCKS5 seamlessly,
01-04-2012, 05:25 AM
Registered: Jan 2012
Originally Posted by evo2
GREAT! tsocks is not working for me (i dont know why), but your trick is about to save my life!
It’s working with ubuntu oneiric and socks5 and chromium-browser, only had to add
change SOCKS for SOCKS5 at the script because of my socks version.
many thanks man!
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
socks client wrapper for cygwin
phil. d. g
03-11-2011 05:42 PM
using socks proxy with torrent client
Linux – Networking
01-22-2011 04:20 AM
ftp client witch socks proxy support
11-26-2003 07:44 PM
IRC Client with Socks Proxy Capability
Linux – Software
05-28-2003 05:58 PM
All times are GMT -5. The time now is 09:57 PM.
Contact Us –
Advertising Info –
Rules – Privacy –
LQ Merchandise –
Contributing Member –
LQ Sitemap –
LQ Job Marketplace
Write for LQ
is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you’d like to contribute
content, let us know.
View New Posts
View Latest Posts
Zero Reply Threads
LQ Wiki Most Wanted
Report LQ Bug
How to setup SOCKS proxy in Linux – Lintel Technologies Blog
A SOCKS server is a general purpose proxy server that establishes a TCP connection to another server on behalf of a client, then routes all the traffic back and forth between the client and the server. It works for any kind of network protocol on any port. SOCKS Version 5 adds additional support for security and UDP.
Use of SOCKS is as a circumvention tool, allowing traffic to bypass Internet filtering to access content otherwise blocked, e. g., by governments, workplaces, schools, and country-specific web services
SOCKS proxies can be created without any special SOCKS proxy software if you have Open SSH installed on your server and an SSH client with dynamic tunnelling support installed on your client computer.
ssh -D 1080 user@
Now, enter your password and make sure to leave the Terminal window open. You have now created a SOCKS proxy at localhost:1080. Only close this window if you wish to disable your local SOCKS proxy.
Using Microsocks program
MicroSocks is a multithreaded, small, efficient SOCKS5 server.
It’s very lightweight, and very light on resources too:
for every client, a thread with a stack size of 8KB is spawned. the main process basically doesn’t consume any resources at all.
the only limits are the amount of file descriptors and the RAM.
It’s also designed to be robust: it handles resource exhaustion gracefully by simply denying new connections, instead of calling abort() as most other programs do these days.
another plus is ease-of-use: no config file necessary, everything can be done from the command line and doesn’t even need any parameters for quick setup.
“`git clone `
Starting socks service
microsocks -1 -i listenip -p port -u user -P password -b bindaddr
all arguments are optional. by default listenip is 0. 0. 0 and port 1080.
option -1 activates auth_once mode: once a specific ip address authed successfully with user/pass, it is added to a whitelist and may use the proxy without auth. this is handy for programs like firefox that don’t support user/pass auth. for it to work you’d basically make one connection with another program that supports it, and then you can use firefox too.
How to force all Linux apps to use SOCKS proxy – Super User
for the impatient just do the following; assuming that the proxy is and it’s socks5 (change it with your own later)
first install redsocks sudo apt-get install redsocks, make an empty file anywhere and name it (or whatever), I’ll assume it’s here /etc/ (change it with your own).
edit the file you created () as follows
log_debug = on;
log_info = on;
log = “stderr”;
daemon = off;
redirector = iptables;}
local_ip = 127. 0. 1;
local_port = 12345;
port = 7777;
type = socks5;
// known types: socks4, socks5, -connect, -relay
// login = username;
// password = password;}
change 7777 with your proxy,
(note that you can use any local_port other than 12345, it’s the local port that we will set an iptable rule to redirect the traffic to, so if you use another, make sure to use it in later steps below)
— now run redsocks with the config file destination as follows
sudo redsocks -c /etc/
change with the destination of your
(if you get “bind: Address already in use” try killall redsocks)
you can also check if redsocks is bound to local port 12345 with netstat -tulpn
— now that redsocks is running and ready, let’s change the iptables rules to use redsocks. this should be customized to your needs, but if you like to redirect all HTTP and HTTPS packets through the proxy. Define the following rules.
sudo iptables -t nat -N REDSOCKS
sudo iptables -t nat -A REDSOCKS -d 0. 0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 10. 0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 127. 0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 169. 254. 0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 172. 16. 0/12 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 192. 168. 0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 224. 0/4 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 240. 0/4 -j RETURN
sudo iptables -t nat -A REDSOCKS -p tcp -j REDIRECT –to-ports 12345
sudo iptables -t nat -A OUTPUT -p tcp –dport 443 -j REDSOCKS
sudo iptables -t nat -A OUTPUT -p tcp –dport 80 -j REDSOCKS
sudo iptables -t nat -A PREROUTING -p tcp –dport 443 -j REDSOCKS
sudo iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDSOCKS
now your and traffic should be redirected through
if you want your iptables reset use:
iptables -t nat -F
iptables -t mangle -F
additional tip: if you have vpn on your iphone or android, you can use it for free in your pc whatever the OS is. just connect the phone vpn app, and establish a socks proxy server ( in android you can use ‘servers ultimate’ app) then use the proxy in your pc as above, now all your pc traffic is routed through your phone vpn. neat.