Skip to content
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

How to use a local IP address instead of localhost ? #4025

Closed
1 task done
glemiere opened this issue Mar 18, 2018 · 5 comments · Fixed by #4829
Closed
1 task done

How to use a local IP address instead of localhost ? #4025

glemiere opened this issue Mar 18, 2018 · 5 comments · Fixed by #4829
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@glemiere
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Sorry in advance if I didn't find any informations. If this behavior is actually possible, please specify it in the README.

Expected Behavior

Being able to use an IP (10.x.x.x) instead of localhost while using next dev.

Current Behavior

Dev server launch on localhost.

@timneutkens
Copy link
Member

@glemiere https://github.com/zeit/next.js/blob/canary/bin/next-dev#L34

Lets document this in the readme 👍

@timneutkens timneutkens added help wanted good first issue Easy to fix issues, good for newcomers labels Mar 18, 2018
@glemiere
Copy link
Author

glemiere commented Mar 18, 2018

Thank you! I also noticed that next --help doesn't give any infos about that. The CLI might need an update as well ;)

@glemiere
Copy link
Author

glemiere commented Mar 19, 2018

@timneutkens I saw help was wanted, so I made a PR that you may appreciate. ;-)
#4027

@James-E-Adams
Copy link

I was looking at documenting this in the readme, but I can only get it working with a few values:

Works:

  • --hostname 127.0.0.1
  • --hostname localhost
  • --hostname 0.0.0.0

Doesn't work:

  • --hostname blabla
  • --hostname 0.0.0.5
  • --hostname 127.0.1.1

What should be expected to work?

@timneutkens
Copy link
Member

https://github.com/zeit/next.js/blob/canary/bin/next-dev#L56

https://github.com/zeit/next.js/blob/canary/server/index.js#L290

As you can see the value is directly passed into Node.js's http.listen, so any value that doesn't work is related to Node.js not supporting it I guess.

timneutkens pushed a commit that referenced this issue Jul 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants