microsocks
microsocks copied to clipboard
Allow binding to another (non-default) interface
SO_BINDTODEVICE seems to be a linux-specific API. what prevents you from using the ip address of the specified interface with the existing -b option?
The existing -b
option only works when the specified IP is on the same interface as the default route interface. When machine have multiple interfaces and the bind-ip is not on the default interface, this options solves the problem.
Nice feature, but works only under linux.
what prevents you from using the ip address of the specified interface with the existing -b option?
It would be nice to listen on a different interface that the outgoing connections.
The problem is that if the IP address set by the -b
option is on the default route, the default route will be used and not the specified interface.
I've patched this PR against master and it works and does exactly what I needed. Would you consider accepting it, please?
i can't merge this PR as-is, because it would break build on solaris, *BSD, and OSX
It is a matter of surrounding the Linux-specific code with #if[def]
fences?
i dont want to litter the code with ugly ifdefs, they need to be in a single spot, if at all