Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.66 KB

README.md

File metadata and controls

60 lines (40 loc) · 1.66 KB

Catberry Socket.io Adapter

Gitter

It is an adapter for Socket.io engine that makes possible to use it from Catberry application.

Installation

npm install catberry-socket.io --save

Usage

You can use the adapter in ./server.js as following:

const cat = catberry.create(config);
const server = http.createServer(app);

const socketIo = require('catberry-socket.io');
socketIo.register(cat.locator);
cat.locator.resolve('socket.ioProvider').registerServer(server);

server.listen(config.server.port);

In ./browser.js as following:

const cat = catberry.create(config);

const socketIo = require('catberry-socket.io');
socketIo.register(cat.locator);
cat.locator.resolve('socket.ioProvider').connectToServer();

In ./build.js as following:

const cat = catberry.create(config);

const socketIo = require('catberry-socket.io');
socketIo.register(cat.locator);

In fact, Catberry CLI does it for you.

Contributing

There are a lot of ways to contribute:

Miha Vizovišek [email protected]

Denis Rechkunov [email protected]