Node-Red configuration
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.

index.js 577B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const polling_1 = require("./polling");
  4. const polling_jsonp_1 = require("./polling-jsonp");
  5. const websocket_1 = require("./websocket");
  6. exports.default = {
  7. polling: polling,
  8. websocket: websocket_1.WebSocket
  9. };
  10. /**
  11. * Polling polymorphic constructor.
  12. *
  13. * @api private
  14. */
  15. function polling(req) {
  16. if ("string" === typeof req._query.j) {
  17. return new polling_jsonp_1.JSONP(req);
  18. }
  19. else {
  20. return new polling_1.Polling(req);
  21. }
  22. }
  23. polling.upgradesTo = ["websocket"];