question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open (-o) option now defaults to http://0.0.0.0

See original GitHub issue

Steps to reproduce the issue, if applicable. Include the actual command and output and/or stack trace.

Run the following simple command: http-server -o some-page.htm

What did you expect to happen? I expect http-server to open some-page.htm automatically in my browser using a valid local address (http://127.0.0.1/some-page.htm)

What actually happened? My browser opened to an empty page on http://0.0.0.0:8080/some-page.htm

Tell us about your environment

  • exact http-server version:: 13.0.1
  • Node version:: 14.15.2
  • Platform:: Win 10

Other information (related issues, suggestions for a fix, etc): This issue just popped up when I updated from v0.12.3 to 13.0.1 and it is caused by issue https://github.com/http-party/http-server/issues/615 and pull https://github.com/http-party/http-server/pull/642. After some research, I realized I can fix it by adding the address to use -a to my command line arguments like so…

http-server -o some-page.htm -a http://127.0.0.1

But the -o option previously worked without specifying the address. Shouldn’t the server still default to 127.0.1 if no address is specified? As far as I can tell, all that pull request was supposed to do was to allow users to set the address to 0.0.0.0, not make it as the new default. But if this was intentional, perhaps you should note in your documentation that the -o option should now be used with the -a option.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
thkruzcommented, Sep 7, 2021

Replicated on http-server 13.0.0, Node 16.9.0 and Win 10.

Reading the README it is clear that 0.0.0.0 is the default, but much like OP I recommend that 127.0.0.1 is used as the default even if the pull request to allow 0.0.0.0 to be used remains. It is far more intuitive.

I am using -a 127.0.0.1 without the http:// and everything works fine for both http and https.

1reaction
thornjadcommented, Sep 13, 2021

Wonderful! This will be fixed in a patch version to be released later today

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Ruby on Rails use http://0.0.0.0:3000 instead of http ...
Basically it said : …navigate to http://localhost:3000. You should see Rails' default information page. But when I follow the instructions, I ...
Read more >
Can't use 0.0.0.0 address · Issue #615 · http-party/http-server
A common reason for Cloud Run services failing to start is that the server process inside the container is configured to listen on...
Read more >
What's the difference between IP address 0.0.0.0 and 127.0.0.1?
0.0 usually means the default route (the route to "the rest of" the internet, aside from routes in your local network etc.). Share....
Read more >
Azure SQL Database and Azure Synapse IP firewall rules
Configure server-level IP firewall rules for a database in Azure SQL Database or Azure Synapse Analytics firewall.
Read more >
Reference Manual For OpenVPN 2.4
A defaulting mechanism exists for specifying options to apply to all <connection> profiles. If any of the above options (with the exception of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found