Sync to origin
This commit is contained in:
commit
576a15c7ff
|
@ -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
|
|
@ -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": {},
|
||||||
|
|
28
src/main.js
28
src/main.js
|
@ -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,6 +177,7 @@ xo.on('started', function () {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// http_servers.forEach(function (http_server) {
|
// http_servers.forEach(function (http_server) {
|
||||||
|
// http_server.on('listening', function () {
|
||||||
// new WSServer({
|
// new WSServer({
|
||||||
// 'server': http_server,
|
// 'server': http_server,
|
||||||
// 'path': '/websockify',
|
// 'path': '/websockify',
|
||||||
|
@ -175,6 +185,7 @@ xo.on('started', function () {
|
||||||
// .on('connection', on_connection);
|
// .on('connection', on_connection);
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
// });
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// JSON-RPC over WebSocket.
|
// JSON-RPC over WebSocket.
|
||||||
|
@ -205,12 +216,14 @@ xo.on('started', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
http_servers.forEach(function (http_server) {
|
http_servers.forEach(function (http_server) {
|
||||||
|
http_server.on('listening', function () {
|
||||||
new WSServer({
|
new WSServer({
|
||||||
'server': http_server,
|
'server': http_server,
|
||||||
'path': '/api/',
|
'path': '/api/',
|
||||||
}).on('connection', on_connection);
|
}).on('connection', on_connection);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// JSON-RPC over TCP.
|
// JSON-RPC over TCP.
|
||||||
|
@ -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
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue