Sync to origin

This commit is contained in:
Martin Dobrev 2013-11-02 15:22:36 +00:00
commit 576a15c7ff
3 changed files with 49 additions and 11 deletions

13
.editorconfig Normal file
View File

@ -0,0 +1,13 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
#
# Tab indentation (size of 4 spaces)
[*]
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true

View File

@ -35,6 +35,7 @@
"bignumber": ">=1.1.0", "bignumber": ">=1.1.0",
"ldapjs": ">=0.6.3", "ldapjs": ">=0.6.3",
"require-all": ">=0.0.3" "require-all": ">=0.0.3"
"superstack": "0.0.3"
}, },
"devDependencies": {}, "devDependencies": {},
"optionalDependencies": {}, "optionalDependencies": {},

View File

@ -1,3 +1,12 @@
// Enables strict mode for this whole file.
'use strict';
// node.js does not give complete stacktrace with async code,
// superstack is here for that!
require('superstack');
//-------------------------------------
var _ = require('underscore'); var _ = require('underscore');
var connect = require('connect'); var connect = require('connect');
var fs = require('fs'); var fs = require('fs');
@ -168,11 +177,13 @@ xo.on('started', function () {
// } // }
// http_servers.forEach(function (http_server) { // http_servers.forEach(function (http_server) {
// new WSServer({ // http_server.on('listening', function () {
// 'server': http_server, // new WSServer({
// 'path': '/websockify', // 'server': http_server,
// }) // 'path': '/websockify',
// .on('connection', on_connection); // })
// .on('connection', on_connection);
// });
// }); // });
// }); // });
@ -205,10 +216,12 @@ xo.on('started', function () {
} }
http_servers.forEach(function (http_server) { http_servers.forEach(function (http_server) {
new WSServer({ http_server.on('listening', function () {
'server': http_server, new WSServer({
'path': '/api/', 'server': http_server,
}).on('connection', on_connection); 'path': '/api/',
}).on('connection', on_connection);
});
}); });
}); });
@ -405,7 +418,13 @@ read_file(__dirname +'/../config/local.yaml').then(
require('http').createServer().listen(port, host) require('http').createServer().listen(port, host)
.on('listening', function () { .on('listening', function () {
console.info( console.info(
'XO-Server HTTP server is listening on %s:%s', 'HTTP server is listening on %s:%s',
host, port
);
})
.on('error', function () {
console.warn(
'[Warn] HTTP server could not listen on %s:%s',
host, port host, port
); );
}) })
@ -457,7 +476,12 @@ read_file(__dirname +'/../config/local.yaml').then(
'key': key, 'key': key,
}).listen(port, host).on('listening', function () { }).listen(port, host).on('listening', function () {
console.info( console.info(
'XO-Server HTTPS server is listening on %s:%s', 'HTTPS server is listening on %s:%s',
host, port
);
}).on('error', function () {
console.warn(
'[Warn] HTTPS server could not listen on %s:%s',
host, port host, port
); );
}) })