Run iobroker behind a proxy
Peter Bauer last edited by
Since I had to run iobroker behind a web proxy, I had to solve the issue that node does not support proxy requests out of the box.
The solution was to install node-global-proxy like this
# make npm proxy ready > npm config set proxy http://192.168.0.1:8080 # next, install node-global-proxy in iobroker directory > cd /opt/iobroker > npm install node-global-proxy --save # edit controller.js > vi /opt/iobroker/node_modules/iobroker.js-controller/controller.js
and make sure it looks like this:
/** * Redirect for older installations * * Copyright 2018-2022 bluefox <email@example.com>, * MIT License * */ const proxy = require("node-global-proxy").default; proxy.setConfig("proxy.corp.itserv.de:8080"); proxy.start(); require('./main').init();
just in case this helps somebody in the future.
If the integration can be done better than editing
controller.js, please tell me. Thank you.