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.
Signing means that the client will be presented with the certificate in a dialog, prompting him to accept or deny. So, yes, the client needs to allow it. How scary that dialog looks depends on how trusted the certificate is - signing by "Angus Comber" will result in a dialog looking less wholesome than signing by Thawte or Verisign :-)
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.
No, you could straight TCP/IP as well, or some other protocol. HTTP is just convenient because port 80 is probably open already (it would have to be to serve the applet). As long as you can get your sys admin to open some other port, you can use whatever protocol you wish on that port.
Are you talking about standard off-she-shelf proxies? I am thinking my customer could use something standard, eg Microsoft proxy if a Windows server - but how would it know where to send the data to? Do you configure an ultimate remote destination for each port?
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?
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?
I don't like your attitude. I, like many people, asked a question because I am unsure or don't know the answer. Sarcastic comments are really not helpful.
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?
You can't expect to wield supreme executive power just because
Free, earth friendly heat - from the CodeRanch trailboss