title: How to open a socket on specific interface in Node JS?
body: <p>I want to know how it is possible to open simply a socket on a specific interface (eth0, wlan0, ...) in Node JS.</p>
  
  <p>It seems to <a href="https://stackoverflow.com/questions/3998569/how-to-bind-raw-socket-to-specific-interface">be possible in C</a> and possible also with ping command with <code>ping -I eth0 google.com</code>.</p>
  
  <p>But how to do that with Node JS ?
  I have seen nothing in <a href="https://nodejs.org/api/net.html#net_socket_connect" rel="nofollow noreferrer">net.Socket documentation</a>.</p>
  
  <p>I have found <a href="https://github.com/nodejs/node/issues/3625#issuecomment-153005680" rel="nofollow noreferrer">some code</a> that wrap dynamic library but there should be a easier way to do that. No ?
  Something like <code>socket.connect({host :"google.com", port:80, interface:"eth0"});</code></p>