dante   Frontpage - Dante - Download - Status - Support - Modules - Docs - Links - Survey - GDPR


This page describes how to do use the redirect module to redirect traffic going through the Dante SOCKS server to different locations.

The official BSD licensed distribution of Dante includes a SOCKS server with all functionality required to interact with SOCKS clients. Some additional functionality is however offered as modules that can be purchased separately. The redirect module can be used to modify traffic by redirecting it to a different location than the client requested. A typical usage scenario would be to direct HTTP traffic going to an undesired location to a page describing why the request was denied.

Redirection is done in the SOCKS command pass rules. A redirect to or redirect from keyword is added to modify the behavior of the rule.

Redirection to proxy

pass {
   from: to: port = http
   command: connect
   redirect to: squid.example.com port = 3128

The rule above redirects clients from the network that want to connect to the HTTP port of any address to the address squid.example.com, port 3128. This type of redirection is useful in cases where it is desired to make clients use an application specific proxy, rather than connecting directly. In this example, a HTTP proxy is used. Note that the redirect keyword does not alter the data from the client in any way, it only redirects it.

Server port range usage limiting

pass {
   from: to:
   redirect from: eth1 port 30000 - 40000

It some usage scenarios it can be desired to restrict the port ranges used by the Dante server. This would for example make it possible for a firewall to know which port numbers will be used by the SOCKS server. The rule above ensures that the server will limit itself to using ports in the range 30000 to 40000 on the interface eth1, for all traffic originating from clients on the network.

Copyright © 1998-2023 Inferno Nettverk A/S