Add support for local host and port binding - #238
Conversation
|
🆒 Looks good. What is the use case for this? Sorry for the lame question, I just have no idea why I would use this so I'm curious as to what you are using it for. |
|
It's for use when you have multiple IP-addresses bound to a single machine, on a single interface. To give you an example, I have a single interface, on which I have bound 2 IPv4 addresses, and a single IPv6 address. With this change, I can choose which address I want to connect from. If I were running a TOR relay on one of my IPv4 addresses, and wanted to connect to a HTTP service that automatically denies access to all IP-addresses that are on a DNS blacklist (which many TOR nodes are), I could circumvent this by connecting from my other IP address. |
There was a problem hiding this comment.
This test should be wrapped with the ruby version if statement as well.
|
With the tweak I just mentioned I'll happily pull it. |
Add support for local host and port binding
Add support for specifying a local host and port to bind to, before connecting.
This was implemented as per https://bugs.ruby-lang.org/issues/6617 and only works for Ruby 2.0 or later.