mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-24 04:36:31 +00:00
18 lines
727 B
JavaScript
18 lines
727 B
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const net_1 = __importDefault(require("net"));
|
|
const debug_1 = __importDefault(require("debug"));
|
|
const debug = (0, debug_1.default)('mqttjs:tcp');
|
|
const buildStream = (client, opts) => {
|
|
opts.port = opts.port || 1883;
|
|
opts.hostname = opts.hostname || opts.host || 'localhost';
|
|
const { port } = opts;
|
|
const host = opts.hostname;
|
|
debug('port %d and host %s', port, host);
|
|
return net_1.default.createConnection(port, host);
|
|
};
|
|
exports.default = buildStream;
|
|
//# sourceMappingURL=tcp.js.map
|