Skip to content
Ivaylo Ivanov edited this page Jan 16, 2016 · 3 revisions

Defined in Esrol-servers and implemented in Esrol-server-app

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