Question

I have a server written in Java which basically awaits requests from different clients and serves their requests. I am running this server from Eclipse. This server is accessible on the local network but I want to be able to access this service from outside the local network. Is there any way to do this please?

P.S. I am a real beginner in these things

Was it helpful?

Solution

you can open a port in the router that leads to the one that the server is listening on. You then connect to your public IP. This ip can be found on

OTHER TIPS

As @Java Player said, the problem is that your router(Nat) denied any incoming packet to your local network...briefly, there is many solutions for this:

  1. Third party server: you must have a dedicated server that plays the role of intermediary, between your client/server programs.

    Pros:

    • Solve completely the problem related to the Nat.

    Cons:

    • In addition of your client, you must code another third party that forward packet to the desired destination.

    • BTW it gets a little heavy(waste of bandwidth).

  2. Reversed connexion: the server and the client program are reversed, that's mean the client become a server and the server become a client, 'used by most of trojan...

    Pros:

    • Very easy to implement this approach.

    cons:

    • You must at least has an opened port.
  3. Udp hole punching: this approach is used by perhaps all peer2peer solutions(eg: skype, utorrent...).

    Pros:

    • You don't need to any router configuration.
    • Direct connection between peers.

    Cons:

    • You need also a third party server called STUN server to get informations about your router.
    • Not all router that works with udp hole punching, you must consider also the first solution.
    • Writing a hole punching solution is not easy task.

You could also download something like Hamachi and then download Hamachi and sign into your network on the other PCs and Macs (and Linux...which is currently in beta). Then you'll want to be able to access your server on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top