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.

incoming-message.js 963B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 'use strict';
  2. const {Readable} = require('stream');
  3. class IncomingMessage extends Readable {
  4. constructor(socket, highWaterMark) {
  5. super({
  6. highWaterMark,
  7. autoDestroy: false
  8. });
  9. this.statusCode = null;
  10. this.statusMessage = '';
  11. this.httpVersion = '2.0';
  12. this.httpVersionMajor = 2;
  13. this.httpVersionMinor = 0;
  14. this.headers = {};
  15. this.trailers = {};
  16. this.req = null;
  17. this.aborted = false;
  18. this.complete = false;
  19. this.upgrade = null;
  20. this.rawHeaders = [];
  21. this.rawTrailers = [];
  22. this.socket = socket;
  23. this.connection = socket;
  24. this._dumped = false;
  25. }
  26. _destroy(error) {
  27. this.req._request.destroy(error);
  28. }
  29. setTimeout(ms, callback) {
  30. this.req.setTimeout(ms, callback);
  31. return this;
  32. }
  33. _dump() {
  34. if (!this._dumped) {
  35. this._dumped = true;
  36. this.removeAllListeners('data');
  37. this.resume();
  38. }
  39. }
  40. _read() {
  41. if (this.req) {
  42. this.req._request.resume();
  43. }
  44. }
  45. }
  46. module.exports = IncomingMessage;