From d2f9db824136358a06dc3dd566644f3a016f24e2 Mon Sep 17 00:00:00 2001 From: Radu Serbanescu Date: Mon, 16 Oct 2017 18:32:45 +0300 Subject: [PATCH] Add use case for proxy to HTTPS using a PKCS12 client certificate --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 9eb56bb..64cbb4f 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,24 @@ httpProxy.createServer({ }).listen(443); ``` +##### HTTP -> HTTPS (using a PKCS12 client certificate) + +```js +// +// Create an HTTP proxy server with an HTTPS target +// +httpProxy.createProxyServer({ + target: { + protocol: 'https:', + host: 'my-domain-name', + port: 443, + pfx: fs.readFileSync('path/to/certificate.p12'), + passphrase: 'password', + }, + changeOrigin: true, +}).listen(8000); +``` + **[Back to top](#table-of-contents)** #### Proxying WebSockets