'Redirecting client to servers and enable direct connection
I am trying to solve a problem that appear to be simple but I can't find a clean architecture.
The problem: I have a client trying to access a server in a Local network.
|Router|------|Client
| |
|------|Server
On that server I have a webapp exposed on port X. When you are behind the router (and thus the firewall) then you can easily access the webapp and use it. I would like the same to happen when outside of the local network.
Client|------|Router|-------|Server
Easy solution: The basic solution is port forwarding and to simply open port X on the router. I don't want this solution because I can't open ports (for different reason unrelated).
Better Idea I am thinking of setting up the following architecture where a new server (called B) is introduced.
Client|------|Server B|-------|Router|-------|Server A
The idea, is that Server A will maintain a connection (socket.io or websocket) with server B. This will prevent any port forwarding as Server A is making the first move. Then if the client wants to access Server A, it will access server B that will redirect it to server A.
After the first call, Ideally I would like the client to establish a direct connection with server A, without going through B.
Questions:
- Is that possible ?
- It seems that there are tools (CND, reverse proxy) but they don't exactly fit my needs, or maybe I just don't know how to use them ?
- Which tools to use on server A and B (websocket, socket.io, Nginx, Apache ...). Both servers are using linux.
Thanks !
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
