Question: Over the weekend I set up all the networking for a game I was making. I was basing it off this tutorial: [GamesFromScratch.com Basic LibGDX Networking](http://www.gamefromscratch.com/post/2014/03/11/LibGDX-Tutorial-10-Basic-networking.aspx). It said that it only supported TCP but I was okay with that since I could figure something out and there was a bunch of material online on how to make real time games without UDP. After I finished, I tested it on desktop, android and then on HTML5/GWT. Desktop and android worked but GWT didn't. I did some research and found that Gdx.net does not support GWT, the article didn't warn me :/ Basically now I am trying to find an alternative solution that will work with ALL libgdx platforms.

I looked into Websockets with Socket IO. Here are the Java libraries I found for the: [Client](https://github.com/socketio/socket.io-client-java) and [Server](https://github.com/mrniko/netty-socketio). The server library says it works well with the client one which is reassuring. It seems like a good solution but I have a few questions:

**- Would the client library work on all platforms?** It seems that it would work on android and desktop since they don't have to convert to another language but what about GWT and iOS? And not only just work, but also be able to connect to the server using the server library.

**- Is there anything I need to watch out for when using websockets?**

Thanks.

**EDIT:** I did a little bit more research and I found [Jetty](http://www.eclipse.org/jetty/documentation/current/jetty-websocket-client-api.html). I looked around and it seems to be GWT compatible, I just need to know if it is also iOS compatible. And could I use Jetty as my server api also?

Answer: 
I did it. I did a lot of research in the past few days and I finally found [this](https://stackoverflow.com/questions/31448142/libgdx-gwt-websocket-causing-temporary-fps-spikes) post on stackoverflow.com that told me about 2 great libraries including one I could use with the client that supports GWT. 

It works great, the only thing is that I will have to use 2 WebSocket libraries for the client, one on html and another for all the other platforms but that's okay, at least it works. 

The libraries are: [Client](https://github.com/sksamuel/gwt-websockets) and [Server](https://github.com/TooTallNate/Java-WebSocket).
you can use [Kryonet](https://github.com/EsotericSoftware/kryonet) which provide network for PC, Android and iOS(not tested). On this library you can build server side or client side app.
In GWT you have WebSocket and you must use other library to connect with server.
When you start game, you can inject right implementation client for GWT can be example: gwt-websockets and kryonet for other platform.

Next, you must change kryonet default serialization implementation by own, supporting json. In [my project](https://bitbucket.org/radomiej/jfgf/) i use LibGDX json serialization. 

Currently, i don`t have support for gwt but i will work on it in near feature.

Jetty in my opinion is too heavy for client and isn`t simple so much. But witch Spring, you can easy create server service based on REST or http communication.