microsocks icon indicating copy to clipboard operation
microsocks copied to clipboard

add -B bind device option (follows up on #29)

Open peppergrayxyz opened this issue 1 year ago • 3 comments

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/

peppergrayxyz avatar Sep 28 '24 12:09 peppergrayxyz

+1 for this feature. Saves some script cruft to lookup the device IP.

domohawk avatar Jan 09 '25 08:01 domohawk

This is cool. Would help me a lot :) Sad its no merged yet.

bl00dy1837 avatar Feb 21 '25 15:02 bl00dy1837

it helped, thanks!

i couldn't get it to work with -b

MineTheCube avatar Aug 11 '25 20:08 MineTheCube