Reputation: 77626
Is it possible to create a socket based multi-player game client using html5? Does html5 allow socket programming?
Upvotes: 0
Views: 594
Reputation: 471
Sure, i wrote one too - http://sketcharama.com
If you want to use Web Sockets, you should give a try at socket.io
Upvotes: 0
Reputation: 46756
Depends on how "big" your multiplayer is going to be, I've played around with WebSockets recently you can take a look at the results here: http://github.com/BonsaiDen/NodeGame-Shooter
It's definitely pretty easy to get started with this, but the challenge is to keep the actual bandwidth usage low, just using plain JSON will let the bandwidth skyrocket.
Upvotes: 1
Reputation: 24472
HTML5 allows a limited bi-directional communication with server via the WebSocket object. It may allow you to write games what use simple networking but it does not allow raw access to underlying network. So the answer to your questions is:
Yes, but this depends on the complexity of the game and you will have to proxy all messages via the server.
No it does not allow socket programming as, say, as a programing platform such as Java does.
Upvotes: 4
Reputation: 284927
You can use the WebSockets draft standard in supported browsers. According to this question, Chrome, Firefox 4, and Safari support it.
Upvotes: 0