Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/platformatic/undici-tls-dispatcher


https://github.com/platformatic/undici-tls-dispatcher

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# undici-tls-dispatcher

An undici dispatcher to enable TLS for given URLs

## Install

```
npm i undici-tls-dispatcher
```

## Usage

```js
const UndiciTLSDispatcher = require('undici-tls-dispatcher')
const dispatcher = new UndiciTLSDispatcher({
tlsConfig: [
{
url: 'https://yourserver.com',
tls: {
ca: '...'
cert: '...'
key: '...'
}
}
]
})

const res = await request(httpsServerUrl, { dispatcher })
...
```

See `test.js` for a complete example.
## License

Apache 2.0