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.

HttpProxyAgent.js.flow 733B

123456789101112131415161718192021222324252627282930
  1. // @flow
  2. import net from 'net';
  3. import type {
  4. ConnectionCallbackType,
  5. ConnectionConfigurationType,
  6. } from '../types';
  7. import Agent from './Agent';
  8. class HttpProxyAgent extends Agent {
  9. // @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/169#issuecomment-486980290
  10. // eslint-disable-next-line unicorn/prevent-abbreviations
  11. constructor (...args: *) {
  12. super(...args);
  13. this.protocol = 'http:';
  14. this.defaultPort = 80;
  15. }
  16. createConnection (configuration: ConnectionConfigurationType, callback: ConnectionCallbackType) {
  17. const socket = net.connect(
  18. configuration.proxy.port,
  19. configuration.proxy.hostname,
  20. );
  21. callback(null, socket);
  22. }
  23. }
  24. export default HttpProxyAgent;