Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2355

Add SSL and Web Socket Support to Node and JavaScript



    • Patch Info:
      Patch Available


      This patch adds support for SSL between Node.js and Browser JavaScript as well as initial WebSocket transport support.

      The createStaticHTTPThriftServer() method has been renamed createWebServer(). The resulting server supports XHR based HTTP:// and HTTPS:// clients as well as upgrades to WS:// and WSS:// for websocket clients.

      The JavaScript thrift.js library now includes websocket support through TWebSocketTransport. The old XHR transport still goes by the alias Transport but can now also be accessed through the name TXHRTransport. Browser clients can use XHR over HTTP and HTTPS (as always) and also WebSocket (WS://) and secure WebSocket (WSS://).

      The JavaScript grunt build runs jQuery and Normal JavaScript synchronous and asynchronous tests over HTTP and HTTPS. There are now three test drivers in the thrift/lib/js/test directory:

      • test.html the jQuery build test (thrift -gen js:jquery)
      • test-nojq.html the normal JavaScript build test (thrift -gen js)
      • testws.html the web socket test.

      The thrift/test/keys directory supplies the key and cert for the HTTPS test server.

      The root js README was updated and contains a complete client/server example. A new README was added to the test directory providing an orientation there.

      With WebSocket in place it makes sense to consider adding a binary protocol on the browser side.


          Issue Links



              • Assignee:
                codesf Randy Abernethy
                codesf Randy Abernethy
              • Votes:
                1 Vote for this issue
                6 Start watching this issue


                • Created: