sergees
sergees9mo ago

Send request (fetch) via a specific network interface

If a box has multiple network interfaces with their API addresses, how to choose a particular one to send http requests? And also to open web socket tcp connection.
2 Replies
Deno AI Helper
Deno AI Helper9mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on general networking principles, specifying a network interface for outgoing requests is typically a feature that would be handled at the operating system level rather than by individual applications like Deno scripts. In some environments, you might be able to use system tools or configure routing tables to prefer one network interface over another for certain destinations. However, this is not something that you would control directly from Deno's fetch API or WebSocket API. Please note that this advice is not based on the Deno documentation, and I would recommend double-checking the accuracy of this information and exploring system-level networking configurations if this functionality is critical for your application.
sergees
sergeesOP9mo ago
GitHub
Local ip address and network interface support for fetch · Issue #2...
Looks like Deno doesn’t have a built-in way to specify a local IP address or network interface. But reqwest has it. Is is possible to extend Deno.CreateHttpClientOptions to include local_address an...

Did you find this page helpful?