views:

972

answers:

3

Is there a Java-applet implementation of HTML5 WebSockets?

I'd like to use WebSockets for a new project, and provide a backward compatible implementation of WebSockets (for all current non-dev browsers) using Java (or maybe Flash).

I only want to write and maintain WebSockets on the server-side. I only want to have to deal with the WebSockets API on the client side (though this API will be 'faked' by a Java-applet, if real WebSockets aren't available).

Thanks,

Chris.

+1  A: 

Here's one possible implementation (uses Flash as a fallback):

http://github.com/gimite/web-socket-js

No guarantees (I'm away from my development environment right now), but it looks like it'll do what you're looking for.

ZoogieZork
Looks useful - I will test. I'm concerned about the proxy CONNECT issue, but this may not be an issue. So long as the websocket server runs on a different port number and the user's firewall allows outgoing connections to that port, this may be a non-issue.
chrisdew
Yes, it works well, even on AMD64 Ubuntu Karmic.
chrisdew
A: 

Here is another solution that provides support for Java, Flash, Silverlight, and JS. This solution provides backward compatibility with all pre-Websocket browsers.

http://www.kaazing.com/download/

With lots of documentation located here:

http://tech.kaazing.com/

Jonas
Thanks for this info, but I'd already disregarded it due to their licence: http://www.kaazing.com/license
chrisdew
5. PROHIBITED USES. Developer may not: (a) remove or modify any software markings or any notice of Kaazing's proprietary rights; (b) **redistribute** or make the programs available in any manner to any third party;Emphasis is mine.
chrisdew
+1  A: 

Yes there is one, please have look at http://www.jwebsocket.org. Your jWebSocket Team.

Thanks, that look like just what I need. Deploying a web app using jwebsocket and web-socket-js should cover 95%+ of non-chrome browsers.
chrisdew
It doesn't look like a Java-applet implementation of WebSockets.At least from your description, and your demo, which rejects Firefox 3.6 as non compatible: so I suppose client side is currently only in JS on compatible browsers.
PhiLho