2

I have an embedded system which is running the LwIP server(v1.2), I need to be able to stream a data array into the javascript on the client side? I'm looking at using chrome and some HTML5 features, so some people have suggested using websockets. Does anyone know where I need to start to use these with the LwIP framework? Any help at all would be much appreciated!

1 Answer 1

3

WebSockets is a relatively simple protocol so you could use the protocol spec and write your own server. Since lwIP offers a bsd sockets API, you could also search for existing open source C servers. (A quick search shows up this candidate for instance. BTW, note that this code licensed as GPL. You should only use it if you understand the requirements using GPL'd code puts on your project.)

Note that while Chrome support for websockets is good, support is patchier if you later decide to use other browsers (and particularly to allow users with older browsers). See here for details. If support for a variety of browsers matters to you, you'll probably have to include code in client and server to fallback to long polling when a websocket handshake fails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.