Search code examples
webrtcnatstunturn

Is there a way to access a websever behind NAT?


I am trying to access a web server behind NAT. The challenge is: because there could be several web servers coexist, router registration based on port is not a feasible solution here.

I apologize this looks more like general question, because I really don't know where to start after reading online sources related to NAT traversal, which technique to choose: proxy, tunnelling, WebRTC, ICE?

I experiment a little bit with libnice. It will output a string which looks like candidate list that can be sent to the remote peer to let it connect in. But it doesn't look obvious how to embed the string in Http URL.

Your help is highly appreciated. Thanks.


Solution

  • You can have multiple web servers running behind a NAT firewall, by port-forwarding a different port to each web server.

    For example:

    yourip:8080 ->port forward-> web server 0 running on 192.168.1.10
    yourip:8081 ->port forward-> web server 1 running on 192.168.1.11
    yourip:8082 ->port forward-> web server 2 running on 192.168.1.12