Skip to content

Add ability to specify a hostname #19

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

Closed
Timer opened this issue May 10, 2017 · 6 comments · Fixed by #20
Closed

Add ability to specify a hostname #19

Timer opened this issue May 10, 2017 · 6 comments · Fixed by #20

Comments

@Timer
Copy link

Timer commented May 10, 2017

Right now, there is no way to specify a hostname.
This means detect-port is only useful when listening to the default binding address (::, 0.0.0.0).

It would be great if we could optionally pass a hostname, just like the Node API.

@fengmk2
Copy link
Member

fengmk2 commented May 11, 2017

Yes, we can follow the Node API. I will send a pull request this week.

@fengmk2
Copy link
Member

fengmk2 commented May 11, 2017

It's a bug #17

fengmk2 added a commit that referenced this issue May 11, 2017
fengmk2 added a commit that referenced this issue May 11, 2017
fengmk2 added a commit that referenced this issue May 11, 2017
should check current ip too

- closes #17
- closes #19
@Timer
Copy link
Author

Timer commented May 11, 2017

Hi! This didn't fix the issue. It'd be great if we could actually pass the hostname to check explicitly.

@fengmk2 fengmk2 reopened this May 12, 2017
@fengmk2
Copy link
Member

fengmk2 commented May 12, 2017

OK, I get it.

@Timer
Copy link
Author

Timer commented May 12, 2017

I'll add a bit more information for posterity: effectively, we might bind to abc.local which isn't covered by checking ::, localhost, and the current public IP.

In our exact case, we're binding to 0.0.0.0, but not passing a host name to the node API (like #20 added) binds to :: which ALSO works when visiting 0.0.0.0 (but isn't actually bound to it). We could keep adding cases for these addresses but at some point it will start falling apart when we use custom addresses (like abc.local which resolves to some random address).

At the end of the day, I'd love to be able to just tell detect-port what address I'd like to check for port availability on. I still believe checking the other hosts (::, 0.0.0.0, localhost, etc) is still beneficial because it's confusing to have two different applications running on 127.0.0.1 and 0.0.0.0 but using the same port.

@xudafeng
Copy link
Member

#26

@fengmk2 fengmk2 closed this as completed May 16, 2018
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 a pull request may close this issue.

3 participants