How to bind a request to a specific network interface with a Rust Hyper HTTP client?
I have a Linux server with multiple network interfaces. Each interface has its own IP address. How do I force HTTP requests to use a specific interface by specifying its IP address? Just like curl --interface command line option.
+3
source to share
1 answer
You will need to create your own HttpConnector
, perhaps starting with a vanilla connector , perhaps using net2::TcpBuilder
.
This is definitely something that seems like it should be simpler, perhaps indicated in the config. You can hyperlink the issue or submit a pull request if you implement it yourself.
+2
source to share