UNPKG

743 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const net_1 = __importDefault(require("net"));
7const debug_1 = __importDefault(require("debug"));
8const debug = (0, debug_1.default)('mqttjs:tcp');
9const buildStream = (client, opts) => {
10 opts.port = opts.port || 1883;
11 opts.hostname = opts.hostname || opts.host || 'localhost';
12 const { port, path } = opts;
13 const host = opts.hostname;
14 debug('port %d and host %s', port, host);
15 return net_1.default.createConnection({ port, host, path });
16};
17exports.default = buildStream;
18//# sourceMappingURL=tcp.js.map
\No newline at end of file