major wip

This commit is contained in:
Caleb James DeLisle
2017-08-07 16:27:57 +02:00
parent 548bce479a
commit 65dfd99171
14 changed files with 1854 additions and 20 deletions

View File

@@ -32,6 +32,9 @@ var setHeaders = (function () {
if (typeof(config.httpHeaders) !== 'object') { return function () {}; }
const headers = clone(config.httpHeaders);
headers['Access-Control-Allow-Origin'] = "*";
if (config.contentSecurity && false) {
headers['Content-Security-Policy'] = clone(config.contentSecurity);
if (!/;$/.test(headers['Content-Security-Policy'])) { headers['Content-Security-Policy'] += ';' }
@@ -149,6 +152,7 @@ httpServer.listen(config.httpPort,config.httpAddress,function(){
console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps);
});
Http.createServer(app).listen(config.httpPort+1, config.httpAddress);
var wsConfig = { server: httpServer };