Skip to content

Question: Is it possible to start proxy on a random port - how does one retrieve the port? #1675

Open
@Nick-Minutello

Description

@Nick-Minutello

We want to run http-proxy in our automated tests (to simulate the behaviour of our sso reverse proxy). In some cases, we may want to start a number of proxies.

In automated tests, we like to start servers on random free ports, so as to avoid any port clashes.

Of course I could call proxy.listen(0) - but it isn't clear how I can get the resultant port.

Thanks in advance

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