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();
- (@GermanBluefox) Updated packages and typing
- (@GermanBluefox) Added access control options for server
- (@GermanBluefox) Used
@iobroker/eslint-config
for linting
- (@GermanBluefox) Extend the security checker with the pattern detection and custom URL
- (@GermanBluefox) Changed the error text of the security checker
- (@GermanBluefox) added the security checker
- (raintonr) Fix contexts for SNICallback (#3).
- (@GermanBluefox) Update packages
- (@GermanBluefox) Corrected small error with CA certificate
- (@GermanBluefox) Added check of the cert files
- (@GermanBluefox) Corrected error with
getCertificatesAsync
- (@GermanBluefox) Added support for user-configured certificates for fallback
- (@GermanBluefox) Rename
Webserver
toWebServer
- (foxriver76) initial release based on ioBroker/ioBroker.js-controller#2104 by @raintonr