File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ # HTTPS
2
+
3
+ How to proxy requests to various types of HTTPS servers.
4
+
5
+ All options are provided by [ http-proxy] ( https://github.com/nodejitsu/node-http-proxy ) .
6
+
7
+ ## Basic proxy to an HTTPS server
8
+
9
+ ``` javascript
10
+ var proxy = require (' http-proxy-middleware' );
11
+
12
+ var apiProxy = proxy (' /api' , {
13
+ target: ' https://example.org' ,
14
+ changeOrigin: true ,
15
+ });
16
+ ```
17
+
18
+ ## Proxy to an HTTPS server using a PKCS12 client certificate
19
+
20
+ ``` javascript
21
+ var fs = require (' fs' );
22
+ var proxy = require (' http-proxy-middleware' );
23
+
24
+ var apiProxy = proxy (' /api' , {
25
+ target: {
26
+ protocol: ' https:' ,
27
+ host: ' example.org' ,
28
+ port: 443 ,
29
+ pfx: fs .readFileSync (' path/to/certificate.p12' ),
30
+ passphrase: ' password' ,
31
+ },
32
+ changeOrigin: true ,
33
+ });
34
+ ```
You can’t perform that action at this time.
0 commit comments