node-ddp-client
node-ddp-client copied to clipboard
Provide an example for "DDP Client for browsers"
Can you describe the steps required to use the "DDP Client for browsers" in a HTML file?
<html>
<head>
<script src="???"></script>
<script>
var ddpclient = new DDPClient({
host : "localhost",
port : 3000,
ssl : false,
autoReconnect : true,
autoReconnectTimer : 500,
maintainCollections : true,
ddpVersion : '1',
socketConstructor: WebSocket
});
ddpclient.subscribe(...);
ddpclient.on('message', function (msg) {
console.log("ddp message: " + msg);
});
</script>
</head>
<body>
<p>Check the console log for DDP messages</p>
</body>
</html>