Server listen callback with https
Created by: barto-
I would like a callback when the server is listening. This is possible with http
but it doesn't work with https
.
Example:
// ...
var proxyServer = httpProxy.createServer({
ssl: {
key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
},
target: 'https://localhost:9010',
secure: true // Depends on your needs, could be false.
});
proxyServer.listen(443, function listening(err){
console.log('Server listening');
});