Skip to content

Commit

Permalink
more socket io config
Browse files Browse the repository at this point in the history
  • Loading branch information
gabesoft committed Mar 12, 2012
1 parent d372b04 commit 549d738
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/pubsub.coffee
Expand Up @@ -3,12 +3,17 @@ module.exports = (app, pub, sub) ->
ch = 'items-change'

io.configure 'production', () ->
io.enable 'browser client minification'
io.enable 'browser client etag'
io.enable 'browser client gzip'
io.set 'transports', ['xhr-polling']
io.set 'polling duration', 10
io.set 'log level', 1

io.configure 'development', () ->
io.set 'transports', ['websocket']
io.set 'log level', 3

io.sockets.on 'connection', (socket) ->
sub.on 'subscribe', (channel, count) ->
console.log "subscribed to #{channel}:#{count}"
Expand Down
3 changes: 3 additions & 0 deletions server/pubsub.js
Expand Up @@ -5,6 +5,9 @@
io = require('socket.io').listen(app);
ch = 'items-change';
io.configure('production', function() {
io.enable('browser client minification');
io.enable('browser client etag');
io.enable('browser client gzip');
io.set('transports', ['xhr-polling']);
io.set('polling duration', 10);
return io.set('log level', 1);
Expand Down

0 comments on commit 549d738

Please sign in to comment.