Need help with koa.io?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

koajs
426 Stars 49 Forks 89 Commits 10 Opened issues

Description

[MAINTAINERS WANTED] Realtime web framework combine koa and socket.io.

Services available

!
?

Need anything else?

Contributors list

koa.io

Gitter

NPM version build status Test coverage Dependency Status devDependency Status node version

Realtime web framework combine koa and socket.io.

This project is under development now.

Feature

  • socket.io
    support koa style middleware when socket connect and disconnect.
  • socket event route support.
  • Make
    socket.io
    's event handler support generator function.
  • Extent
    socket.io
    's
    socket
    object like
    koa
    's
    context
    , to compact with some
    koa
    's middlewares.

Installation

$ npm install koa.io --save

Usage

var koa = require('koa.io');

var app = koa();

// middleware for koa app.use(function*() { });

// middleware for socket.io's connect and disconnect app.io.use(function* (next) { // on connect yield* next; // on disconnect });

// router for socket event app.io.route('new message', function* () { // we tell the client to execute 'new message' var message = this.args[0]; this.broadcast.emit('new message', message); });

app.listen(3000);

Please check out this simple chat example.

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.