PDA

View Full Version : communication between javascript and c++ code through web socket



apats44
5th August 2011, 14:07
Hi,

I have javascript (client - executed through node.js) and C++ (server) code running on Ubuntu (Linux) and I want this client-server to communicate with each other. Can somebody tell me how I can make C++ code work like a server or client using web socket? Basically, I want javascript code to send some data to C++ code, the C++ code will process on the data and return the result back to javascript code. I'm not sure if I this communication between javascript and C++ code can happen with out web socket. Any pointers in this direction would be of great help!

Thanks,
pats

wysota
6th August 2011, 07:50
Javascript in web browsers can use AJAX. It has some limitations (due to security) but it's practically the only way a generic script can communicate with a web server.

erqsor
18th October 2011, 15:17
I developed a C++ implementation (that uses Qt) of a websocket server.
http://gitorious.org/qtwebsocket

ithanoss
22nd March 2012, 21:08
Thanks for your work, i follow development
I use QtWebSocket in my project, it just works