Closed anissen closed 8 years ago
Yes, I have thought of this too. (Luxe's main target is web). Problem with client side javascript is the only real socket browsers support is websocket. Websocket has a predefined protocol that is different to the existing protocol. I'm think that maybe, somehow a websocket server can run on a different port, and websockets can connect to this. I'll think about it, I go back to school today, but this is definitely on my todo.
Also, a library called Anette did something with Js. I'll see how they did it.
Great that you'll look into this! :+1: For reference, here is a simple example of a Luxe game using WebSockets to communicate with a node.js-server.
Alright, so I've done some work on the server side of this, as you can see in this commit 43ef439.
Alot of the work was already done in HxNet. Now I just need to do the client, and that's easy as haxe has js.html.WebSocket;
as you showed with that link.
Once that is done, I'll see if I have the time to make a luxe example, and this issue should be closed :+1:
Really awesome! :clap: Let me know if you don't have time to make a Luxe example then I'll cook up something :)
Thanks for the example! Closing this, because although the websocket target isn't yet perfect, and has some bugs, those bugs should really be brought up in their own issue. Thanks!
It would be awesome if this library could support the JavaScript target. This would allow games to use this library for a unified networking solution for both native and web targets.