Skip to content

monai/cloudberry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

HTTP/HTTPS middleware driven proxy server

Resources

Stars

Watchers

Forks

Packages

No packages published