CometD client for NodeJS
Clone or download
sbordet Fixes #13 - New cookies sent overwrite ones set in configuration.
Now XHR.setRequestHeader() detects if it's a Cookie header and stores
the cookies in a local storage.
Upon XHR.send() both the global and local cookies are concatenated.
Latest commit f1a3dc0 Oct 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Fixes #13 - New cookies sent overwrite ones set in configuration. Oct 25, 2018
LICENSE Initial commit Mar 29, 2017
README.md Updated README. Jul 4, 2017
cometd-nodejs-client.js Fixes #13 - New cookies sent overwrite ones set in configuration. Oct 25, 2018
package.json Updated version to 1.0.2. Sep 13, 2017

README.md

The CometD Project

CometD NodeJS Client

This project implements adapter code that allows the CometD JavaScript Client to run in a NodeJS environment.

The adapter code exports an implementation of XMLHttpRequest so that the CometD JavaScript Client works in NodeJS as it does within a browser environment.

WebSocket is not (yet) supported.

NPM Installation

Firstly, you need to install the CometD NodeJS Client:

npm install cometd-nodejs-client

The CometD NodeJS Client does not depend on the CometD JavaScript Client; you need the CometD JavaScript Client to develop your applications.

Therefore, you need to install the CometD JavaScript Client, version 3.1.2 or greater:

npm install cometd

Usage

// Run the adapter code that implements XMLHttpRequest.
require('cometd-nodejs-client').adapt();

// Your normal CometD client application here.
var lib = require('cometd');
var cometd = new lib.CometD();
...

See here for an example CometD client application.