Skip to content

not possible to start server listen on ports 80/443 #164

@tim-2

Description

@tim-2

If you start node lib/index.js server -l http://*:80 -l https://*:443 the server does not listen on ports 80/443, but on random ports instead.

On this line an URL is created from the listen location, but the ports 80 and 443 are set to an empty string in the URL object if the protocol is http/https:

new URL('http://localhost:80').port === ""
new URL('https://localhost:443').port === ""

Then the check in this line fails and no port is returned from listenArgsForURL which results in a random port.

I think there should be some checks like this:

if(port === '' and protocol === 'http:') port = 80;
if(port === '' and protocol === 'https:') port = 443;

Or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions