HTML5 Web socket Handshaking

I'm sort of new to web programming, but I wanted to write a HTML interface for a embedded device (coded in C) that I am developing. I've already implemented a stream server (a la beej's socket server example) and a java client, but I'm interested in implementing a HTML5 Socket interface instead.

I am having some trouble with the handshaking (in so much as the server accepts the connection but the web page does not), and was wondering if there was a specification available somewhere on line. The w3c spec seems to only describe the API (as far as I can tell) and not the details of the handshake. I'm not looking for a fully written example (I can do that!) just a reference for the handshaking that is better than the Wikipedia entry (or an explanation of why that entry should be enough to fully understand the spec).

If anyone could help me get it up and running I will happily package it all in a library and demo and put it up on google code.

Thanks... and please let me know if you need more info to help answer the quesiton!


It looks like this is the specifiction here. I'm not much of a web prgrammer myself either. However, based on my limited understanding, I'm curious about whether you really need to implement WebSockets. Could you just using a series of HTTP messages instead?


Did you check your code against existing servers :

http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx?msg=3364691 ? with updated to last websocket specification here : http://nugget.codeplex.com/

Another one here : or http://superwebsocket.codeplex.com/

Not much difference betwee c# eand C in this case...

链接地址: http://www.djcxy.com/p/44694.html

上一篇: 我对HTTP轮询,长轮询,HTTP流和WebSockets的理解

下一篇: HTML5 Web套接字握手