tinyagent
Version:
Connect your local shell to any device - access your dev environment from anywhere
27 lines • 828 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TunnelManager = void 0;
const localtunnel_1 = __importDefault(require("localtunnel"));
class TunnelManager {
tunnel;
async createTunnel(port) {
try {
this.tunnel = await (0, localtunnel_1.default)({ port });
return this.tunnel.url;
}
catch (error) {
throw new Error(`Failed to create tunnel: ${error}`);
}
}
closeTunnel() {
if (this.tunnel) {
this.tunnel.close();
this.tunnel = undefined;
}
}
}
exports.TunnelManager = TunnelManager;
//# sourceMappingURL=tunnel-manager.js.map