Reputation: 106
Is possible to run two different applications on one port but each on different IP?
Like so:
123.456.789.000 -> First NodeJS on port 3000
123.456.789.001 -> Second NodeJS on port 3000
Same Debian9 Machine
Upvotes: 0
Views: 286
Reputation: 444
When socket server is up, the port is reserved for the purpose of this server. It's bound to the host environment and it identifies endpoint within the host, so on single machine you can have only one service listening on specific port to preserve uniqueness.
IP address on the other hand is bound to the network interface and provides the identification of the device within the network. So IP address allows the packages to find you host, whilst port number allows the packages to find your app on your host.
TLDR: No, it's not possible
Upvotes: 2