Node DDP Client
A callback style DDP (Meteor's Distributed Data Protocol) node client, originally based
The client implements version 1 of DDP, as well as fallbacks to pre1 and pre2.
Installation
$ npm install ddp-client
Authentication
Built-in authentication support was removed in ddp 0.7.0 due to changes in Meteor version 0.8.2.
One can authenticate using plain-text logins as follows:
// logging in with e-mailddpclient; // logging in with usernameddpclient;
var DDPClient = ; var ddpclient = // All properties optional, defaults shown host : "localhost" port : 3000 ssl : false autoReconnect : true autoReconnectTimer : 500 maintainCollections : true ddpVersion : '1' // ['1', 'pre2', 'pre1'] available // Use a full url instead of a set of `host`, `port` and `ssl` url: 'wss://example.com/websocket' socketConstructor: WebSocket // Another constructor to create new WebSockets; /* * Connect to the Meteor Server */ddpclient; /* * Useful for debugging and learning the ddp protocol */ddpclient; /* * Close the ddp connection. This will close the socket, removing it * from the event-loop, allowing your application to terminate gracefully */ddpclient; /* * If you need to do something specific on close or errors. * You can also disable autoReconnect and * call ddpclient.connect() when you are ready to re-connect.*/ddpclient; ddpclient; /* * You can access the EJSON object used by ddp. */var oid = ;
Unimplemented Features
The node DDP client does not implement ordered collections, something that while in the DDP spec has not been implemented in Meteor yet.
Thanks
Inspired by https://github.com/oortcloud/node-ddp-client
- Tom Coleman (@tmeasday)
- Thomas Sarlandie (@sarfata)
- Mason Gravitt (@emgee3)
- Mike Bannister (@possiblities)
- Chris Mather (@eventedmind)
- James Gill (@jagill)
- Vaughn Iverson (@vsivsi)