cloudberry
v0.0.8
Published
HTTP/HTTPS middleware driven proxy server
Downloads
5
Maintainers
Readme
cloudberry
Cloudberry is HTTP/HTTPS middleware driven proxy server.
Generate CA signing identity
Generate signing identity:
cloudberry
Generate signing identity and save to macOS default keychain:
cloudberry -K
Usage
const proxy = require('cloudberry');
const key =
`-----BEGIN RSA PRIVATE KEY-----
<...>
-----END RSA PRIVATE KEY-----`;
const cert =
`-----BEGIN CERTIFICATE-----
<...>
-----END CERTIFICATE-----`;
proxy.keychain.getDefaultIdentity((error, identity) => {
if (error) {
identity = { key, cert }; // if not on macOS
}
const ca = proxy.ca(identity);
const server = proxy.createServer({
SNICallback: ca.SNICallback()
}, (req, res) => {
console.log('>', req.url);
proxy.request(ca)(req, res).on('error', console.error);
});
proxy(server).listen(8000);
});
License
ISC