Skip to content

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

@bluepuma77

Description

@bluepuma77

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions