I have a server and client program. client is a java applet.
Previously I could run the server program in the server and the client successfully connected to the server program through the socket's proper port.Now, I switched to a new server and I have problem with this server.
Direct connection (ssh) to this server (let say it is server1) is not possible. I can connect a server2 (ssh), then connection to server1 is possible through the s开发者_如何学Goerver2 (ssh).So now my java applet cannot connect to server1 and it gives connection error.
Do you have any opinions how my applet can connect to server1 now??
If you want a server with a public access on a specific, you should concentrate on having have a public access and not try to connect every server to each other (via ssh).
A simple thing you could do for example is simple port forwarding from a public accessible server to your actual server (containing the java application). With this solution, you only have to change your client so it connects to the accessible server.
If you can not connect to a spesific port on a server, its possibly related to firewall.
As I know, Linux firewall doesnt allows outer connections to ports, if they are not defined as "allowed", in iptables.
You should modify iptables to connect to proper port.
More on iptables.
精彩评论