libwebsockets
libwebsockets copied to clipboard
bind to interface using SO_BINDTODEVICE socket option on Linux platforms
Use the SO_BINDTODEVICE socket option on Linux platforms when binding lws sockets. Current behavior binds to an address on the interface when the interface is specified in lws_socket_bind()
. This forces traffic over a certain interface, which can be useful for multi-homed systems.
This provides similar behavior to libcurl and c-ares libs. On Linux this requires elevated privileges, and failure to bind is non-fatal.