5

How can the TCP traffic initiated by a specific application be forced to go through a SOCKS proxy, regardless of the remote IP or port?

A VPN would direct all outbound traffic on a host through an interface (tun0 typically), so it's an overkill solution. But in a split tunnel configuration, instead of doing that by default, the VPN client offers a SOCKS proxy for specific applications. While browsers support connecting through a SOCKS proxy, many other applications don't.

I've tried dante socksify but it didn't work with common programs like curl and wget. (I've sent a message to their mailing list, but it's not archived anywhere so I can't link to it.)

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Dan Dascalescu
  • 7,519
  • 5
  • 19
  • 25

2 Answers2

6

Wikipedia lists a number of open-source proxifiers. Of those, proxychains-ng seems to be the most actively developed, judging by GitHub activity.

To install and configure,

  1. Download the latest release
  2. Unzip and cd into the directory
  3. ./configure && make
  4. Optional: sudo make install && sudo make install-config
  5. nano /usr/local/etc/proxychains.conf
  6. At the end of the config file, set the SOCKS IP port address

Usage:

proxychains4 -q curl icanhazip.com
Diagon
  • 600
  • 4
  • 13
Dan Dascalescu
  • 7,519
  • 5
  • 19
  • 25
2

Alternative solution:

Proxybound can do the job

proxybound application-command

Note: I am the developer of this program.

Firelord
  • 342
  • 1
  • 17
intika
  • 13,920
  • 7
  • 41
  • 79