S
S
SuperDoker2015-08-12 08:38:42
Computer networks
SuperDoker, 2015-08-12 08:38:42

How to run nodeJS with different IP on the same server?

There is a server (for example VPS) which has several IP addresses. You need to run 2 nodejs scripts with different IPs, and you can’t specify this separately in some module, you need to somehow externally. Maybe in some kind of sandbox, or something else?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Timur Shemsedinov, 2015-08-12
@MarcusAurelius

If the server has multiple IPs, then make listen on 0.0.0.0 or don't specify the second listen parameter at all: server.listen(80)

S
sasha, 2015-08-12
@madmages

https://nodejs.org/api/http.html#http_server_liste...

HttpServer.listen(80, 8.8.8.8);
HttpServer.listen(80, 9.9.9.9);

A
Alexey Ostin, 2015-08-12
@nitso

1) try to change the IP as in the first tip
2) try to change the port and use an external balancer
3) run in a virtual environment (for example, docker)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question