microsocks
microsocks copied to clipboard
add -B bind device option (follows up on #29)
This follows up on https://github.com/rofl0r/microsocks/pull/29
- works on linux and macos
- dedicated file (ifdefs are in a single spot)
- doesn't break the build if feature is unsupported (use stub and return error if used)
- prints a build message if feature is unsupported
It could be integrated into socksrv.c as well, but #include <netinet/in.h> must be included with _GNU_SOURCE or _DARWIN_C_SOURCE set (depending on the platform) and this doesn't play well with the way the server.h currently works.
References:
- https://github.com/wine-mirror/wine/blob/wine-9.18/server/sock.c#L2151
- https://djangocas.dev/blog/linux/linux-SO_BINDTODEVICE-and-mac-IP_BOUND_IF-to-bind-socket-to-a-network-interface/
+1 for this feature. Saves some script cruft to lookup the device IP.
This is cool. Would help me a lot :) Sad its no merged yet.
it helped, thanks!
i couldn't get it to work with -b