Skip to content

Commit

Permalink
#fix attach IO class, not socket to the koa instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstyles committed Jan 18, 2016
1 parent bffd585 commit 592c6e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion example/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ chat.on( 'connection', ctx => {
})
chat.on( 'message', ctx => {
console.log( 'chat message received', ctx.data )
chat.broadcast( 'message', 'yo connections, lets chat' )
// app.chat.broadcast( 'message', 'yo connections, lets chat' )
chat.broadcast( 'message', 'ok connections:chat' )
})

const PORT = 3000
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module.exports = class IO {
throw new Error( 'Namespace ' + id + ' already attached to koa instance' )
}

app[ id ] = this.socket
app[ id ] = this
}

/**
Expand Down

0 comments on commit 592c6e3

Please sign in to comment.