Skip to content
Ivaylo Ivanov edited this page Dec 28, 2015 · 3 revisions

The sockets component allows you to handle sockets from different types of servers. Each handle must export onRequest method.

TCP

app/sockets/tcp/index.js

'use strict';
module.exports = class Index {

  static onRequest(socket) {
    // code
  }

};

UDP

app/sockets/udp/index.js

'use strict';
module.exports = class Index {

  static onRequest(message, info) {
    // code
  }
  
};

HTTP WEBSOCKET

app/sockets/http-websocket/index.js

'use strict';
module.exports = class Index {

  static onRequest(socket) {
    // code
  }

};

Clone this wiki locally