• 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

Applet games, stock streamer

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Does anybody know how the typical applet games, stock streams work across firewalls?

I am assuming the applets must be connecting to the back-end servers through HTTP. But since it is only the applet who can make requests to the server (not the other way round), is the applet limited to polling the server for events/updated data? This does not seem a viable solution if the events need to be real-time.

Any idea how this problem is solved?
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Firewalls are usually one-way. They prevent incoming connections, not outgoing. The applet is free to connect back to it's originating server using whatever protocol it desires.
 
Victor Ho
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joe Ess:
Firewalls are usually one-way. They prevent incoming connections, not outgoing. The applet is free to connect back to it's originating server using whatever protocol it desires.



But if we were to consider for a generic solution, any idea how it is done? For example, my company's firewall only allows outgoing HTTP traffic but I am still able to access stock streamers like Datek's/AmeriTrade's.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Install a firewall like Zone Labs Zone Alarm which will alert you to outgoing connections. That will let you know what the streamer is up to. Since free stock tickers aren't intended to compete with professional trader's stock feeds it may be that it simply polls some web server every few minutes.
When you say that the firewall blocks everything but outgoing HTTP, do you mean that it blocks every outgoing request that isn't going to a remote port 80 (standard HTTP port)? Can you use HTTPS (port 443) FTP (21) or SSH (22)? If the firewall allows any of these connections to be made all one would have to do is have their web server offer the custom service on that port rather than the standard service.
You could also digitally sign the applet and have it download from one server's port 80 via HTTP and connect back to another server's port 80 via your application's custom protocol for updates.
 
Victor Ho
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joe Ess:
When you say that the firewall blocks everything but outgoing HTTP, do you mean that it blocks every outgoing request that isn't going to a remote port 80 (standard HTTP port)? Can you use HTTPS (port 443) FTP (21) or SSH (22)? If the firewall allows any of these connections to be made all one would have to do is have their web server offer the custom service on that port rather than the standard service.


My company's firewall blocks outgoing FTP, SSH and only allows HTTP/S through proxy.

Originally posted by Joe Ess:
You could also digitally sign the applet and have it download from one server's port 80 via HTTP and connect back to another server's port 80 via your application's custom protocol for updates.


Maybe I misunderstood you here, but if my firewall only allows HTTP/S (either incoming/outgoing), the applet still needs to poll the server right?
I am trying to find a solution that the server can push real-time events to the applet with my setup.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Victor Ho:

Maybe I misunderstood you here, but if my firewall only allows HTTP/S (either incoming/outgoing), the applet still needs to poll the server right?



That depends on HOW it is blocking the traffic. If it is blocking it by port number, like the Linux kernel firewall, iptable, does, you can send non-HTTP traffic to a server with that port and use any protocol you want. You will have to do some research on your company's firewall setup and write some tests to see what your options are.
Another option to think about is to have a servlet take a client HTTP request and hold onto it until something interesting happens, then respond to it. It isn't quite client-server, but it's better than polling.
 
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic