Server to Server communication with only one IP available

49 views
Skip to first unread message

aeneas Winterhalter

unread,
Oct 11, 2014, 10:32:22 PM10/11/14
to nod...@googlegroups.com
Hello,

I have two node.js backend-servers. Server A has a static IP and can be reached from anywhere. Server B is behind a gateway and has no static IP.
If I want to send a message from Server B to Server A with Shuttle or socket.io, I can easy set the static IP of server A as receiver and send my message.
Now, how can Server A send a response to that message to server B? The server doesn't know its IP address and even if - that would be the external IP of the gateway
and not the IP of the node.js server.
Just for understanding: I don't want to send single stand alone messages from Server B to Server A, it's just about responding. Is there a difference?

Of course, I could make a VPN network between those servers, but I think there should be an easier solution or do I just have an error in reasoning?

Thanks.

Aria Stewart

unread,
Oct 11, 2014, 10:49:14 PM10/11/14
to nod...@googlegroups.com

> On 11 Oct 2014, at 22:32, aeneas Winterhalter <w.ae...@googlemail.com> wrote:
>
> Hello,
>
> I have two node.js backend-servers. Server A has a static IP and can be reached from anywhere. Server B is behind a gateway and has no static IP.
> If I want to send a message from Server B to Server A with Shuttle or socket.io, I can easy set the static IP of server A as receiver and send my message.
> Now, how can Server A send a response to that message to server B? The server doesn't know its IP address and even if - that would be the external IP of the gateway
> and not the IP of the node.js server.
> Just for understanding: I don't want to send single stand alone messages from Server B to Server A, it's just about responding. Is there a difference?
>

Yes, there is: When you're dealing with a NAT gateway, the initiator has to be the one hidden behind the gateway, unless you want to do special configuration.

All this is at the TCP protocol level -- below HTTP, below websockets and socket.io; basically, the requestor can start a connection, and then over that connection, things will flow as you'd expect.

Aria
Reply all
Reply to author
Forward
Message has been deleted
0 new messages