It appears that NATS is using quite some bidirectional connections between ports 4222 <=> ~[49500;55000].
After a quick count, there are about 170 connections found via netstat for port 4222. So 85 connections from 4222 to ... and 85 connections from ... to 4222:
We have an application that uses a webhook in the port range of 50000 and there's a concern that NATS will take over these port(s), making the webhooks rather impossible.
Is this normal behavior + should there be such a concern?
Can/should this be configured?
Hi,
Windows uses the port range 49152-65535 as a dynamic client port range, in which it hands out client ports to applications that want to make outgoing connections (in this case NATS).
Typically it is not recommended to use listening ports in this range, as the port might be in use when the application wants to start listening. However, once a listening port (such as 50000) is open, I don't believe Windows will hand out that port to any client application.
So:
- Before the webhook is active on port 50000, any client application might start using port 50000 for outgoing connections and prevent the webhook from initializing properly
- once the webhook is active/listening, its port cannot get taken over until it stops listening.
Hope this helps