Results 1 to 4 of 4

Thread: communication between javascript and c++ code through web socket

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Platforms
    Unix/X11

    Default communication between javascript and c++ code through web socket

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: communication between javascript and c++ code through web socket

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2010
    Posts
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: communication between javascript and c++ code through web socket

    I developed a C++ implementation (that uses Qt) of a websocket server.
    http://gitorious.org/qtwebsocket

  4. #4
    Join Date
    Nov 2009
    Location
    Częstochowa, Poland
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: communication between javascript and c++ code through web socket

    Thanks for your work, i follow development
    I use QtWebSocket in my project, it just works

Similar Threads

  1. execute a small piece of javascript code ?
    By cornucopia in forum Qt Webkit
    Replies: 2
    Last Post: 28th February 2012, 14:00
  2. QTcpServer/Socket Bidrirectional Communication
    By shhtk in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2011, 08:27
  3. javascript communication with QWebView
    By bittuthegr8 in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2010, 13:12
  4. Qt socket communication
    By ketan in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2009, 09:04
  5. Replies: 1
    Last Post: 27th March 2009, 13:20

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.