Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

createProxyController.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _Logger = _interopRequireDefault(require("../Logger"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. const log = _Logger.default.child({
  9. namespace: 'createProxyController'
  10. });
  11. const KNOWN_PROPERTY_NAMES = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];
  12. const createProxyController = () => {
  13. // eslint-disable-next-line fp/no-proxy
  14. return new Proxy({
  15. HTTP_PROXY: null,
  16. HTTPS_PROXY: null,
  17. NO_PROXY: null
  18. }, {
  19. set: (subject, name, value) => {
  20. if (!KNOWN_PROPERTY_NAMES.includes(name)) {
  21. throw new Error('Cannot set an unmapped property "' + name + '".');
  22. }
  23. subject[name] = value;
  24. log.info({
  25. change: {
  26. name,
  27. value
  28. },
  29. newConfiguration: subject
  30. }, 'configuration changed');
  31. return true;
  32. }
  33. });
  34. };
  35. var _default = createProxyController;
  36. exports.default = _default;
  37. //# sourceMappingURL=createProxyController.js.map