Skip to content

Add support for local host and port binding - #238

Merged
jnunemaker merged 3 commits into
jnunemaker:masterfrom
mkroman:master
Sep 25, 2013
Merged

Add support for local host and port binding#238
jnunemaker merged 3 commits into
jnunemaker:masterfrom
mkroman:master

Conversation

@mkroman

@mkroman mkroman commented Sep 24, 2013

Copy link
Copy Markdown
Contributor

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.

@jnunemaker

Copy link
Copy Markdown
Owner

🆒 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.

@mkroman

mkroman commented Sep 25, 2013

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be wrapped with the ruby version if statement as well.

@jnunemaker

Copy link
Copy Markdown
Owner

With the tweak I just mentioned I'll happily pull it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. 😏

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah. Missed it. Thanks.

jnunemaker pushed a commit that referenced this pull request Sep 25, 2013
Add support for local host and port binding
@jnunemaker
jnunemaker merged commit ef79d0f into jnunemaker:master Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants