Skip to content

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

@timmhayes

Description

@timmhayes

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 #615 and 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions