Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'/google': { port: 80, host: 'google.com' }
})
).listen(8000);
//
// Target Http Server (to listen for requests on 'localhost')
//
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2));
res.end();
}).listen(9000);
// And finally, some colored startup output.
util.puts('http proxy server'.blue + ' started '.green.bold + 'on port '.blue + '8000'.yellow);
util.puts('http server '.blue + 'started '.green.bold + 'on port '.blue + '9000 '.yellow);
// Tell the proxy to listen on port 8000
//
proxy.listen(8005);
//
// Listen for the `error` event on `proxy`.
proxy.on('error', function (err, req, res) {
res.writeHead(500, {
'Content-Type': 'text/plain'
});
res.end('Something went wrong. And we are reporting a custom error message.');
});
util.puts('http proxy server '.blue + 'started '.green.bold + 'on port '.blue + '8005 '.yellow + 'with custom error message'.magenta.underline);
child.on('exit', function (code) {
// util.print('child process exited with code ' + code);
util.puts('Exiting application...')
});
}
serializer.on('end', function () {
util.puts(triples);
});
function _done(error) {
if (error) {
util.puts("BB10-Webworks BUILD FAILED:\n" + error);
process.exit(1);
} else {
util.puts("BB10-Webworks BUILD SUCCESS");
process.exit();
}
}
function puts(s){util.puts(s)}
function inspect(o){puts(util.inspect(o))}
var println = (function(msg){
return util["puts"](msg);
});
var pp = (function(obj){
var file = cov.files[name];
util.print(' | ' + utils.rpad(name, 40));
util.print(' | ' + utils.lpad(file.coverage, 8));
util.print(' | ' + utils.lpad(file.LOC, 4));
util.print(' | ' + utils.lpad(file.SLOC, 4));
util.print(' | ' + utils.lpad(file.totalMisses, 6));
util.print(' |\n');
}
util.puts(sep);
util.print(' ' + utils.rpad('', 40));
util.print(' | ' + utils.lpad(cov.coverage, 8));
util.print(' | ' + utils.lpad(cov.LOC, 4));
util.print(' | ' + utils.lpad(cov.SLOC, 4));
util.print(' | ' + utils.lpad(cov.totalMisses, 6));
util.print(' |\n');
util.puts(lastSep);
};
function finish_file(){
sys.puts(body);
}