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

nodejs: xhr and websocket support for browserify

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.3
    • Node.js - Library
    • None
    • Trusty64 Vagrant box

    • Patch Available

    Description

      The attached patch adds support for XHR connections and WebSocket connections in the browser. Currently there are only tests for XHR since phantomjs 1.x.x does not fully support the websockets protocol. Once phantom 2.x.x is released a test for websockets will be added. Currently only TJSONProtocol and TBufferedTransport are supported. More work needs to be done to get other protocols and transports to work.

      To make browser tests work, all tests were converted to substack/tape (which is a TAP testing harness that works both on the server and in the browser). This has the side effect of making the tests way more readable.

      Depends on the patches on these issues applied in this order:
      THRIFT-2932 - Node.js Thrift connection libraries throw Exceptions into event emitter
      THRIFT-2969 - nodejs: DRY up library tests
      THRIFT-2964 - nodejs: move protocols and transports into separate files

      Attachments

        Activity

          Can someone help with an example on how to use the nodejs implementation in the browser with browserify?

          emmenlau Mario Emmenlauer added a comment - Can someone help with an example on how to use the nodejs implementation in the browser with browserify?
          hudson Hudson added a comment -

          SUCCESS: Integrated in Thrift #1458 (See https://builds.apache.org/job/Thrift/1458/)
          THRIFT-2976: add browserify support and tests (ra: rev d8187c5ff1d8b83d170cbce69282688be39df19c)

          • lib/nodejs/test/browser_client.js
          • package.json
          • lib/nodejs/test/test_handler.js
          • lib/nodejs/lib/thrift/ws_transport.js
          • lib/nodejs/test/test-cases.js
          • lib/nodejs/test/test_driver.js
          • lib/nodejs/lib/thrift/web_server.js
          • lib/nodejs/lib/thrift/index.js
          • lib/nodejs/lib/thrift/json_protocol.js
          • lib/nodejs/test/binary.test.js
          • lib/nodejs/test/server.js
          • lib/nodejs/lib/thrift/xhr_connection.js
          • lib/nodejs/test/testAll.sh
          • lib/nodejs/lib/thrift/browser.js
          • lib/nodejs/lib/thrift/multiplexed_protocol.js
          • lib/nodejs/lib/thrift/ws_connection.js
          hudson Hudson added a comment - SUCCESS: Integrated in Thrift #1458 (See https://builds.apache.org/job/Thrift/1458/ ) THRIFT-2976 : add browserify support and tests (ra: rev d8187c5ff1d8b83d170cbce69282688be39df19c) lib/nodejs/test/browser_client.js package.json lib/nodejs/test/test_handler.js lib/nodejs/lib/thrift/ws_transport.js lib/nodejs/test/test-cases.js lib/nodejs/test/test_driver.js lib/nodejs/lib/thrift/web_server.js lib/nodejs/lib/thrift/index.js lib/nodejs/lib/thrift/json_protocol.js lib/nodejs/test/binary.test.js lib/nodejs/test/server.js lib/nodejs/lib/thrift/xhr_connection.js lib/nodejs/test/testAll.sh lib/nodejs/lib/thrift/browser.js lib/nodejs/lib/thrift/multiplexed_protocol.js lib/nodejs/lib/thrift/ws_connection.js

          Committed. Thanks for the patch Andrew!

          codesf Randy Abernethy added a comment - Committed. Thanks for the patch Andrew!

          Here is a brand new re-rolled patch that will apply cleanly on top of the new patch in THRIFT-2969

          andrewdeandrade Andrew de Andrade added a comment - Here is a brand new re-rolled patch that will apply cleanly on top of the new patch in THRIFT-2969

          People

            codesf Randy Abernethy
            andrewdeandrade Andrew de Andrade
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: