12345678910111213141516171819202122232425262728293031 |
- var fs = require('fs');
- var pomelo = require('pomelo');
- /**
- * Init app for client.
- */
- var app = pomelo.createApp();
- app.set('name', '$');
- // app configuration
- app.configure('production|development', 'connector', function(){
- app.set('connectorConfig',
- {
- connector : pomelo.connectors.hybridconnector,
- heartbeat : 3,
- useDict : true,
- useProtobuf : true,
- ssl: {
- type: 'wss',
- key: fs.readFileSync('../shared/server.key'),
- cert: fs.readFileSync('../shared/server.crt')
- }
- });
- });
- // start app
- app.start();
- process.on('uncaughtException', function (err) {
- console.error(' Caught exception: ' + err.stack);
- });
|