How to use the faye/src/faye_browser.Client function in faye

To help you get started, we’ve selected a few faye examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodeca / nodeca.core / client / common / system / live.js View on Github external
function initFayeClient() {
    fayeClient = new faye.Client('/io/live');

    fayeClient.addExtension({
      outgoing(message, callback) {
        // If session is new & token does not exist, request a new one
        if (!token) {
          tokenUpdate(() => {
            message.token = token;
            callback(message);
          });
          return;
        }

        message.token = token;
        callback(message);
      },
      incoming(message, callback) {

faye

Simple pub/sub messaging for the web

Apache-2.0
Latest version published 4 years ago

Package Health Score

76 / 100
Full package analysis