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.

Thoughts on automatically selecting a new port if there is a port conflict?

See original GitHub issue

I was starting an unrelated tool and had this output, which was quite the delight! image

HTML Pages is Online! 🚀
Serving {project} at http://10.0.2.15:4201 (on port 4201, because 4200 is already in use)
The address was copied to the clipboard :)

Server is ready!

the port changing and dumping the address to the clipboard is neat (even though I’m just going to use localhost, cause reasons)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rwjbluecommented, May 16, 2021

FWIW, you can get this behavior manually by setting the port to 0 (--port 0).

We’ve talked a bit about making that the default before. I’d be in favor.

1reaction
takshchcommented, May 15, 2021

@NullVoxPopuli I think it can produce unnecessary complexity for the developer. Sometimes, port is harded in environment and if port automatically changed, then it will result in errors and issues. So, I think we should use a flag like --auto-port because if developer used this flag, then that developer might know what it is about and they can handle accordingly.

Please tell me what do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Port Forward: Conflicts with all of them. - Verizon Forums
-Go into your router and try to create a port forward. Pick anyone from the list that includes a TCP port. If you...
Read more >
Upgraded to Windows 10 Printer Port Conflict
I upgraded to Window 10 now I have port conflict when I install my HP photosmart 8450. ... It is automatically installed on...
Read more >
Automatic port selection anomaly - UPnP and Port Forwarding ...
If I turn off UPnP then the port automatically defaults to 3074 without issue. So my questions: What is actually happening here?
Read more >
Resolving USB Conflicts with Virtual COM Ports | RBD TechSpot
Many applications require you to specify the port for the selected device. Others (like Actuel for the 9103) poll the COM ports in...
Read more >
Sometimes I get a message, 'specified port already open ...
What causes the 'port already open' message and how to fix it · Sleeping computer with locked resource · Software bugs · Another...
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