0

Trying to use Node's experimental http2-module and want to select the network interface used for outbound connections.

Using the standard http-module in node, this can be done by specifying either the localAddress-argument on a connection or a socket as detailed in this SO-answer.

Unfortunately, the localAddress-argument is nowhere to be found in the http2-docs.

Is this possible?

Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
  • 1
    Did you try localAddress option the same way as in http? Since it's experimental, there's a chance that it's still undocumented. – Estus Flask Jun 06 '18 at 18:57
  • 1
    @estus is right. As per https://nodejs.org/api/http2.html#http2_http2_connect_authority_options_listener , `http2.connect` supports `net.connect` options. In other words `localAddress`. – Mukesh Sharma Jun 06 '18 at 19:10
  • Missed that 1-liner in the docs. Cheers! – Geert-Jan Jun 06 '18 at 21:53

0 Answers0