DEV Community

Discussion on: How do you decide your application port number?

Collapse
 
weswedding profile image
Weston Wedding • Edited

Random high 4-digit (or more) integer to keep it out of the reserved 1024 ports. I try to keep in round, like 867000 and not 8675309

If I'm writing software that will be used on random people's PCs or on computers where there might be a wide variety of software running I will take a deliberate step and search on Google for potential conflicts.

Otherwise, the random port number on an isolated single-purpose system such as a Raspberry Pi or Arduino or even an internal web server is probably good enough.

Collapse
 
reza7rm profile image
reza7rm

Actually 867000 is out of the valid range of 0 - 65535 :D

Collapse
 
weswedding profile image
Weston Wedding

Haha! Whoops. Well, shave some digits off those random numbers.