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",
"ldapjs": ">=0.6.3",
"require-all": ">=0.0.3"
"superstack": "0.0.3"
},
"devDependencies": {},
"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 connect = require('connect');
var fs = require('fs');
@ -168,6 +177,7 @@ xo.on('started', function () {
// }
// http_servers.forEach(function (http_server) {
// http_server.on('listening', function () {
// new WSServer({
// 'server': http_server,
// 'path': '/websockify',
@ -175,6 +185,7 @@ xo.on('started', function () {
// .on('connection', on_connection);
// });
// });
// });
//////////////////////////////////////////////////////////////////////
// JSON-RPC over WebSocket.
@ -205,12 +216,14 @@ xo.on('started', function () {
}
http_servers.forEach(function (http_server) {
http_server.on('listening', function () {
new WSServer({
'server': http_server,
'path': '/api/',
}).on('connection', on_connection);
});
});
});
//////////////////////////////////////////////////////////////////////
// JSON-RPC over TCP.
@ -405,7 +418,13 @@ read_file(__dirname +'/../config/local.yaml').then(
require('http').createServer().listen(port, host)
.on('listening', function () {
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
);
})
@ -457,7 +476,12 @@ read_file(__dirname +'/../config/local.yaml').then(
'key': key,
}).listen(port, host).on('listening', function () {
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
);
})