-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create connection via file descriptor instead of port #3204
Comments
I'll take a PR where |
Just commenting this issue to keep informed about that. If in this half time no ones send the PR I will try to do this request. |
@thebergamo next time just subscribe to it. No need to waste everyone's time. |
sorry! |
Note that you might be able to do this already using |
Not that I think this would be a bad change, but you can already do this: server.connection({autoListen: false});
server.listener.listen(...);
server.start(...); |
I appreciate the workarounds, everyone. I have posted a $40 bounty as I don't currently have time to work on it. But this will be very useful, particularly for those who care about security. |
@sholladay is there a way to get an This addition itself is simple to implement but having to use non-public API for tests might be a deal-breaker. |
That does suck. I'm not aware of any other way. On the other hand, there is a very minimal amount of code that would be necessary in a test. Also, There was even some discussion of exposing this particular use of |
That discussion stills seems very much open to a change in position. Personally, I think until there's a properly documented or accepted way to use it, the workarounds given above are your best option. Unless @hueniverse disagrees and is happy to use |
Hmm well We can at least assert that I'm not saying this is perfect. But it seems like with a bit of work one ought to be able to meet the threshold to get a PR accepted. I mean the important part here IMO is making sure that none of Hapi's internals freak out, not that Node follows its own documentation. Just trying to be pragmatic here, since I believe that accepting a |
It's not really about making sure Node follows its own documentation, it's about how to test that the feature works with hapi internals. For example, you'd ideally want to check that hapi is setting the right address and info values here which are only populated once the You would also want to test making a request to that port and making sure it reaches your handler logic. So we could easily allow specifying an |
Yeah, that's exactly what I was thinking. I can't think of a way to test that without Assuming that is off the table, I guess the question is what would the tests have to do for such a PR to get accepted? |
If this becomes messy, I am going to reject it. There is a workaround and no one else has asked for this. Whatever anyone proposes has to be so trivial, I don't have to think about it. |
The feature can be trivially added, it just can't be trivially tested, as far as I can tell. |
Closing for now. If a PR shows up we can reconsider. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Node's
Server#listen()
method accepts afd
option and I am wondering if hapi could support something like that.The reason this would be useful to me is that I want to use substack's tcp-bind and sindresorhus' root-check to drop privileges as soon as possible.
As a simplified example, I wish something like this worked when run with
sudo
:The benefit here is that I can drop privileges as soon as possible, without waiting for the
start
callback, etc.The text was updated successfully, but these errors were encountered: