Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an example for "DDP Client for browsers" #19

Open
bluepuma77 opened this issue Feb 25, 2016 · 0 comments
Open

Provide an example for "DDP Client for browsers" #19

bluepuma77 opened this issue Feb 25, 2016 · 0 comments

Comments

@bluepuma77
Copy link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant