This module provides a webserver, which automatically takes care of certificate handling using the ioBroker certificates.
Install via npm i @iobroker/webserver
.
Use the webserver in your ioBroker adapter as the following:
- TypeScript:
import { WebServer } from '@iobroker/webserver';
const webServer = new WebServer({ app, adapter, secure: true });
// initialize and you can use your server as known
const server = await webServer.init();
- JavaScript:
const { WebServer } = require('@iobroker/webserver');
const webServer = new WebServer({ app, adapter, secure: true });
// initialize and you can use your server as known
const server = await webServer.init();
And so you can use CertificateManager
that is used in the WebServer already:
- TypeScript:
import { CertificateManager } from '@iobroker/webserver';
// Not required for server
const certManager = new CertificateManager({ adapter });
// get all collections
const collections = await certManager.getAllCollections();
- JavaScript:
const { CertificateManager } = require('@iobroker/webserver');
// Not required for server
const certManager = new CertificateManager({ adapter });
// get all collections
const collections = await certManager.getAllCollections();
- (bluefox) Added access control options for server
- (bluefox) Used
@iobroker/eslint-config
for linting
- (bluefox) Extend the security checker with the pattern detection and custom URL
- (bluefox) Changed the error text of the security checker
- (bluefox) added the security checker
- (raintonr) Fix contexts for SNICallback (#3).
- (bluefox) Update packages
- (bluefox) Corrected small error with CA certificate
- (bluefox) Added check of the cert files
- (bluefox) Corrected error with
getCertificatesAsync
- (bluefox) Added support for user-configured certificates for fallback
- (bluefox) Rename
Webserver
toWebServer
- (foxriver76) initial release based on https://github.com/ioBroker/ioBroker.js-controller/pull/2104 by @raintonr