• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sending data to an applet.

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sending data to an applet.

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.
 
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Angus Comber
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am interested in the proxy use. But if the socket communication is to be proxied does that mean that the protocol would have to be HTTP? Is it generally only http traffic that can be proxied?
 
Tim Moores
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Angus Comber
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Angus Comber
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic