Neanderthals Paint Mammals
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

cloudberry

0.0.8 • Public • Published

cloudberry

NPM Version

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

install

npm i cloudberry

Downloadsweekly downloads

17

version

0.0.8

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability