I know that an unsigned Java applet can only make a socket connection to a socket server on the same host as the web server (from which its hosting web page was downloaded).
I need my Java applet to be able to receive data from a remote server. So my idea is to run a socket server on the web server which the Java applet will connect to and then the Java applet can poll for data. Is this the only way? Any ideas would be welcome?
Another idea I thought about was to have a proxy on the web server redirect data on a particular port (the port used by the remote server) from the web server host to the host where the server resides. Is this possible?
How do others do this type of thing?
Or am I best to sign my applet? But if I sign my applet does each client have to 'allow' the applet to run? I need it to be easy for clients.
Running a proxy on your web server is a common approach, though, assuming you don't expect thousands of users, or your web server's connectivity sucks, or its connectivity to the target machine sucks.
Eg my real remote server, realserv, listens on port 5000. I then get the proxy to redirect to realserv:5000 ? Is that all you need to do?
While it sounds logical that you would configure port forwarding on a proxy in this way, I did not know because I have no experience configuring proxies. If I did I wouldn't have asked the question. So thank you for the information but you should seriously think about your arrogant attitude.
Paul Clapham wrote:You're asking about port forwarding, it seems. In that case yes, when you configure port forwarding for a port, you do have to configure where the requests get forwarded to. Would be kind of pointless without that information, wouldn't it?