I'm loving using debian ,at same time install node.js .
小众软件
分享亲自实践的一些软件、教程。
2018年12月29日星期六
2018年12月28日星期五
[solved]How to set cors-anywhere https?
First i'm using lnmp,when you using it .Most of tuturial unuseless.
1.Modify your Nginx Vhost Files. For example.Listen on 443 port.
2.When we want to visit this proxy.will throuth https://cors.<domain>.com:8080.
so we need modify cors-anywhere.
Another way is to deploy a standalone CORS Anywhere application,
but you need to make some modifications to the native server.js to support the HTTPS protocol.
To put it simply, read the certificate file
(make sure the current user user has read and write access
to the certificate file) as a parameter to the httpsOptions option
and pass it to the https.createServer() method.
1.Modify your Nginx Vhost Files. For example.Listen on 443 port.
2.When we want to visit this proxy.will throuth https://cors.<domain>.com:8080.
so we need modify cors-anywhere.
Another way is to deploy a standalone CORS Anywhere application,
but you need to make some modifications to the native server.js to support the HTTPS protocol.
To put it simply, read the certificate file
(make sure the current user user has read and write access
to the certificate file) as a parameter to the httpsOptions option
and pass it to the https.createServer() method.
chmod -R 0770 /etc/letsencrypt/live/chown -R root:user /etc/letsencrypt/live/ |
1
2
3
4
5
6
7
8
9
10
11
12
13
| // server-standalone.jsvar fs = require('fs');// ...var cors_proxy = require('./lib/cors-anywhere');cors_proxy.createServer({ httpsOptions: { key: fs.readFileSync('/etc/letsencrypt/live/cors.<domain>.com/privkey.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/cors.<domain>.com/fullchain.pem') }, // ...}).listen(port, host, function() { console.log('Running CORS Anywhere on ' + host + ':' + port);}); |
There are some chinese picture
2015年10月27日星期二
订阅:
评论 (Atom)

