1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | const net_1 = __importDefault(require("net"));
|
7 | const debug_1 = __importDefault(require("debug"));
|
8 | const debug = (0, debug_1.default)('mqttjs:tcp');
|
9 | const 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 | };
|
17 | exports.default = buildStream;
|
18 |
|
\ | No newline at end of file |