Create socks proxy server

Socks proxy are the simplest form of proxy to hide the IP address. Even though it is not as secure and anonymous as VPN, it serves the purpose of hiding the IP address quickly without much configuration.

We can find many freely available socks proxies. Most of them are highly insecure and overloaded.

If you have a spare VPS/ box which is connected to internet, we can create our own secure socks proxies.

This is an handy guide for those who like to create their own socks proxy server.

Installation of Dante socks server:

Dante is a product developed by Inferno Nettverk A/S. It consists of a SOCKS server and a SOCKS client, implementing RFC 1928 and related standards. It is a flexible product that can be used to provide convenient and secure network connectivity.
We  can install dante server by issuing the below commands :
apt-get install dante-server

Configuration of socks server:

Configure the socks server by creating/modifying the config file.
vi  /etc/danted.conf
Sample Config file:
logoutput: /var/log/socks.log
internal: venet0:0 port = 1001
external: <<VPS/SERVER IP>>
method: username none #rfc931
clientmethod: none
user.privileged: root
user.notprivileged: nobody
user.libwrap: nobody

# allowed IP ranges
client pass {
        from: 107.170.67.186/24 port 1-65535 to: 0.0.0.0/0
        log: connect disconnect error
}

# block everyone else
client block {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect error disconnect
}

pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        protocol: tcp udp
}

Replace the <<VPS/SERVER IP>> with the server IP.
I am using 1001 port for the socks proxy.

To make the socks server secure and to prevent network abuse, change the allowed IP ranges and ports appropriately.

In the above example config , I am allowing all ranges/ports of IP 107.170.67.186. We can create individual lines for each of the allowed IP ranges.

I am also blocking every other connections apart from those white listed.

Usage of socks server.

 Once the configuration is done,start the socks server by issuing below command.

/etc/init.d/danted start

P.S : Exact command may vary based on the distro used.

To stop the socks server , issue command :

/etc/init.d/danted stop


To use this socks proxy, change the network config/browser settings to point to the server IP and the port mentioned in the config file.

About This Blog

There is something for everyone. !! A tech blog on various topics. Let it be devops, programming etc; we have it all covered here in layman terms :)

Total Pageviews

Back to TOP