aryaxt
aryaxt

Reputation: 77626

Is HTML5 advanced enough to be used for a socket based application?

Is it possible to create a socket based multi-player game client using html5? Does html5 allow socket programming?

Upvotes: 0

Views: 594

Answers (5)

Berti92
Berti92

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

Rob
Rob

Reputation: 15168

HTML5 has nothing to do with sockets unless you mean WebSockets.

Upvotes: 0

Ivo Wetzel
Ivo Wetzel

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

naikus
naikus

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:

  1. Yes, but this depends on the complexity of the game and you will have to proxy all messages via the server.

  2. No it does not allow socket programming as, say, as a programing platform such as Java does.

Upvotes: 4

Matthew Flaschen
Matthew Flaschen

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

Related Questions