Allow binding to non local address if supported #329

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

is there any chance this could get merged ? I can update documentation and maybe improve the patch but not unless it can get merged.

What it does is allowing to bind to any address (as far as I know only FreeBSD and OpenBSD support this):

EM.bind_connect('1.2.3.4', nil, '192.168.0.1', 8000, Handler)
EM::open_datagram_socket('1.2.3.4', nil, Handler)

The main use is writing transparent proxy as you can bind to any non local address with this patch (only enabled if your are root and currently only for OpenBSD).

@schmurfy schmurfy Allow binding to non local address if supported
Only enabled under OpenBSD as root
1b10f5b

Honestly I don't care I can keep my patch fo myself but an answer would be nice...

Contributor

ibc commented Aug 28, 2012

You WONT get an answer from EventMachine developers, never, they have abandoned this project forever (just some stupid pure Ruby improvement every 5 months).

Please fork EventMachine-LE and I will very please to include your pull request (since it's really interesting):

https://github.com/ibc/EventMachine-LE

BTW Linux also allows binding in a non local IP when setting the proper Kernel parameter.

Contributor

wyhaines commented Aug 29, 2012

On Tue, Aug 28, 2012 at 4:54 PM, Iñaki Baz Castillo <
notifications@github.com> wrote:

You WONT get an answer from EventMachine developers, never, they have
abandoned this project forever (just some stupid pure Ruby improvement
every 5 months).

Please fork EventMachine-LE and I will very please to include your pull
request (since it's really interesting):

https://github.com/ibc/EventMachine-LE

BTW Linux also allows binding in a non local IP when setting the proper
Kernel parameter.

I have been busy on other things, but I just assumed that it was still
being maintained by Aman. I guess I should have been paying more attention.
Has EM really been abandoned?

I could resume work on it myself if that is the case.

Kirk Haines

for my point of view the project is drifting and although release candidates are slowly moving the project towards the holy 1.0.0 (with the last stable version released 3 years ago if I remember well) I am really unsure about what will happen with this project after that.
And if this impression is wrong then some real communications is needed to clearly state where the project is and where it is going.

As for myself I am currently looking at other options to replace eventmachine altogether in my active projects.

Contributor

ibc commented Aug 29, 2012

Hi @schmurfy, authors of EM say just nothing and the project is completely stopped (see the commit history of the last years). There are lots of good pull requests and bug reports that are ignored forever.

Please check EventMachine-LE which includes some of those pull requests and useful improvements (like real and tested IPv6 support, new TLS features and so on).

Contributor

garbagecat commented Aug 29, 2012

All, I've been away from the project due to the pressures of my job. If no one else is moving the project forward, I would be willing to step back in and make key decisions.

Is anyone paying attention to this thread willing to help in this task?

On Aug 29, 2012, at 6:26 AM, Julien Ammous wrote:

for my point of view the project is drifting and although release candidates are slowly moving the project towards the holy 1.0.0 (with the last stable version released 3 years ago if I remember well) I am really unsure about what will happen with this project after that.
And if this impression is wrong then some real communications is needed to clearly state where the project is and where it is going.

As for myself I am currently looking at other options to replace eventmachine altogether in my active projects.


Reply to this email directly or view it on GitHub.

Contributor

wyhaines commented Aug 29, 2012

Francis, lets talk. I haven't paid extensive attention over the last
year-ish, but just assumed it was still under Aman's management. I can step
back in and start moving things along.

Kirk
On Aug 29, 2012 5:53 AM, "Francis Cianfrocca" notifications@github.com
wrote:

All, I've been away from the project due to the pressures of my job. If no
one else is moving the project forward, I would be willing to step back in
and make key decisions.

Is anyone paying attention to this thread willing to help in this task?

On Aug 29, 2012, at 6:26 AM, Julien Ammous wrote:

for my point of view the project is drifting and although release
candidates are slowly moving the project towards the holy 1.0.0 (with the
last stable version released 3 years ago if I remember well) I am really
unsure about what will happen with this project after that.
And if this impression is wrong then some real communications is needed
to clearly state where the project is and where it is going.

As for myself I am currently looking at other options to replace
eventmachine altogether in my active projects.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/eventmachine/eventmachine/pull/329#issuecomment-8122811.

Contributor

garbagecat commented Aug 29, 2012

Glad to hear from you, Kirk. Can you send me a private email?

On Aug 29, 2012, at 7:59 AM, Kirk Haines wrote:

Francis, lets talk. I haven't paid extensive attention over the last
year-ish, but just assumed it was still under Aman's management. I can step
back in and start moving things along.

Kirk
On Aug 29, 2012 5:53 AM, "Francis Cianfrocca" notifications@github.com
wrote:

All, I've been away from the project due to the pressures of my job. If no
one else is moving the project forward, I would be willing to step back in
and make key decisions.

Is anyone paying attention to this thread willing to help in this task?

On Aug 29, 2012, at 6:26 AM, Julien Ammous wrote:

for my point of view the project is drifting and although release
candidates are slowly moving the project towards the holy 1.0.0 (with the
last stable version released 3 years ago if I remember well) I am really
unsure about what will happen with this project after that.
And if this impression is wrong then some real communications is needed
to clearly state where the project is and where it is going.

As for myself I am currently looking at other options to replace
eventmachine altogether in my active projects.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/eventmachine/eventmachine/pull/329#issuecomment-8122811.


Reply to this email directly or view it on GitHub.

Contributor

ibc commented Aug 29, 2012

Related to the pull request, Linux does not define SO_BINDANY but it does allow listening into non local addresses via:

sysctl net.ipv4.ip_nonlocal_bind=1

http://linux-ip.net/html/adv-nonlocal-bind.html

I will have a look at your fork but my pull request is now 4 months old and I am not sure I want to dig back into it to add linux support (not now at least). It should not be too hard since the only thing required is a way to detect whether non local binding is allowed or not.

But that's nice to know linux supports this as it may come really handy for advanced (some could say weird too ;) ) usage.

Contributor

ibc commented Aug 30, 2012

What I mean is that, in case of Linux, there is no need for adding nothing:

root:~# sysctl net.ipv4.ip_nonlocal_bind
net.ipv4.ip_nonlocal_bind = 0

root:~# irb
EM.run { EM.start_server "1.2.3.4", 9999 }
=> RuntimeError: no acceptor (port is in use or requires root privileges)

root:~# sysctl net.ipv4.ip_nonlocal_bind=1
net.ipv4.ip_nonlocal_bind = 1

root:~# irb
EM.run { EM.start_server "1.2.3.4", 9999 }
# it works

root:~# netstat -putan | grep 9999
tcp    0   0   1.2.3.4:9999     0.0.0.0:*     LISTEN   25275/irb

oh nice !
I did not realize it meant no changes was required in EM for this to work under linux.

schmurfy commented May 6, 2013

let's close this, I have pretty much given up on EventMachine anyway.

schmurfy closed this May 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment