接受 SSL 流量的节点 http 代理端口号
node http proxy port number to accept SSL traffic
以下示例取自 node-http-proxy
的 github 页面
HTTPS -> HTTP
//
// Create the HTTPS proxy server in front of a HTTP server
//
httpProxy.createServer({
target: {
host: 'localhost',
port: 9009
},
ssl: {
key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
}
}).listen(8009);
问题:为什么 httpProxy 不侦听端口 443 以获取安全的 SSL 流量?
SSL 的默认端口为 443,但与常规 HTTP 协议一样,它也有默认的 80 端口,它可以绑定到自定义端口并通过在 url(https://localhost:8009). Based on this answer.
以下示例取自 node-http-proxy
的 github 页面HTTPS -> HTTP
//
// Create the HTTPS proxy server in front of a HTTP server
//
httpProxy.createServer({
target: {
host: 'localhost',
port: 9009
},
ssl: {
key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
}
}).listen(8009);
问题:为什么 httpProxy 不侦听端口 443 以获取安全的 SSL 流量?
SSL 的默认端口为 443,但与常规 HTTP 协议一样,它也有默认的 80 端口,它可以绑定到自定义端口并通过在 url(https://localhost:8009). Based on this answer.