app.js.sio 645 B

12345678910111213141516171819202122232425262728
  1. var pomelo = require('pomelo');
  2. /**
  3. * Init app for client.
  4. */
  5. var app = pomelo.createApp();
  6. app.set('name', '$');
  7. // app configuration
  8. app.configure('production|development', 'connector', function(){
  9. app.set('connectorConfig',
  10. {
  11. connector : pomelo.connectors.sioconnector,
  12. //websocket, htmlfile, xhr-polling, jsonp-polling, flashsocket
  13. transports : ['websocket'],
  14. heartbeats : true,
  15. closeTimeout : 60,
  16. heartbeatTimeout : 60,
  17. heartbeatInterval : 25
  18. });
  19. });
  20. // start app
  21. app.start();
  22. process.on('uncaughtException', function (err) {
  23. console.error(' Caught exception: ' + err.stack);
  24. });