https://github.com/monai/cloudberry
HTTP/HTTPS middleware driven proxy server
https://github.com/monai/cloudberry
Last synced: 4 months ago
JSON representation
HTTP/HTTPS middleware driven proxy server
- Host: GitHub
- URL: https://github.com/monai/cloudberry
- Owner: monai
- Created: 2016-08-06T08:40:35.000Z (almost 10 years ago)
- Default Branch: develop
- Last Pushed: 2023-04-17T09:43:56.000Z (about 3 years ago)
- Last Synced: 2025-05-19T07:11:20.302Z (about 1 year ago)
- Language: JavaScript
- Size: 1.4 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cloudberry
[](https://www.npmjs.org/package/cloudberry)
Cloudberry is HTTP/HTTPS middleware driven proxy server.
## Generate CA signing identity
Generate signing identity:
```shell
cloudberry
```
Generate signing identity and save to macOS default keychain:
```shell
cloudberry -K
```
## Usage
```js
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