@cubetiq/hlt
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -0,1 +1,7 @@ | ||
### 11/07/2023 | ||
- Support Client API | ||
- Support Proxy (HTTP/HTTPS) and TCP | ||
- Improvements and Bugs fixed | ||
### 30/11/2022 | ||
@@ -2,0 +8,0 @@ |
@@ -17,5 +17,28 @@ "use strict"; | ||
})(); | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TunnelResponse = exports.TunnelRequest = void 0; | ||
var stream = require("stream"); | ||
var stream = __importStar(require("stream")); | ||
var TunnelRequest = /** @class */ (function (_super) { | ||
@@ -79,3 +102,3 @@ __extends(TunnelRequest, _super); | ||
if (duplex) { | ||
// for websocket request: bidirection | ||
// for websocket request: bidirection | ||
var onResponsePipe_1 = function (responseId, data) { | ||
@@ -82,0 +105,0 @@ if (_this.responseId === responseId) { |
@@ -49,5 +49,8 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTokenFree = void 0; | ||
var axios = require("axios"); | ||
var axios_1 = __importDefault(require("axios")); | ||
var getTokenFree = function (baseUrl, data) { | ||
@@ -59,3 +62,3 @@ if (data === void 0) { data = {}; } | ||
url = "".concat(baseUrl, "/__free__/api/get_token"); | ||
return [2 /*return*/, axios({ | ||
return [2 /*return*/, (0, axios_1.default)({ | ||
method: "POST", | ||
@@ -62,0 +65,0 @@ url: url, |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateUUID = exports.addPrefixOnHttpSchema = void 0; | ||
var crypto = require("crypto"); | ||
exports.generateUUID = exports.addPrefixOnHttpSchema = exports.isValidTarget = exports.isValidHost = exports.isValidPort = exports.isValidHostname = exports.isValidIP = exports.isValidUrl = void 0; | ||
var crypto = __importStar(require("crypto")); | ||
var addPrefixOnHttpSchema = function (url, prefixDomain) { | ||
@@ -19,1 +42,40 @@ var prefixSubDomain = prefixDomain; | ||
exports.generateUUID = generateUUID; | ||
var isValidUrl = function (url) { | ||
try { | ||
new URL(url); | ||
return true; | ||
} | ||
catch (err) { | ||
return false; | ||
} | ||
}; | ||
exports.isValidUrl = isValidUrl; | ||
var isValidIP = function (ip) { | ||
var regex = new RegExp("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.|$)){4}$"); | ||
return regex.test(ip); | ||
}; | ||
exports.isValidIP = isValidIP; | ||
var isValidHostname = function (hostname) { | ||
var regex = new RegExp("^(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.?)+(?:(?:[a-z]{2,}\\.)?[a-z]{2,})|localhost)$", "i"); | ||
return regex.test(hostname) || (0, exports.isValidIP)(hostname); | ||
}; | ||
exports.isValidHostname = isValidHostname; | ||
var isValidPort = function (port) { | ||
return port > 0 && port < 65536; | ||
}; | ||
exports.isValidPort = isValidPort; | ||
var isValidHost = function (host) { | ||
var _a = host.split(":"), hostname = _a[0], port = _a[1]; | ||
return (0, exports.isValidHostname)(hostname) && (0, exports.isValidPort)(parseInt(port, 10)); | ||
}; | ||
exports.isValidHost = isValidHost; | ||
var isValidTarget = function (target) { | ||
if ((0, exports.isValidUrl)(target)) { | ||
return true; | ||
} | ||
if ((0, exports.isValidHost)(target)) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
exports.isValidTarget = isValidTarget; |
{ | ||
"name": "@cubetiq/hlt", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A lightweight http tunnel client using nodejs and socket.io client", | ||
"main": "dist/client.js", | ||
"main": "dist/cli.js", | ||
"bin": { | ||
@@ -10,5 +10,6 @@ "hlt": "bin/hlt" | ||
"scripts": { | ||
"start": "ts-node-dev --respawn --transpile-only src/client.ts", | ||
"local": "ts-node-dev --respawn --transpile-only src/client.ts start -p local", | ||
"build": "tsc" | ||
"start": "ts-node-dev --respawn --transpile-only src/cli.ts", | ||
"test": "ts-node-dev --respawn --transpile-only test/test.ts", | ||
"local": "ts-node-dev --respawn --transpile-only src/cli.ts start -p local", | ||
"build": "rimraf dist && tsc" | ||
}, | ||
@@ -27,4 +28,6 @@ "repository": { | ||
"axios": "^1.2.0", | ||
"commander": "^9.3.0", | ||
"https-proxy-agent": "^5.0.1", | ||
"commander": "^11.0.0", | ||
"express": "^4.18.2", | ||
"http-proxy-middleware": "^2.0.6", | ||
"https-proxy-agent": "^7.0.0", | ||
"socket.io-client": "^4.5.1" | ||
@@ -36,6 +39,8 @@ }, | ||
"devDependencies": { | ||
"@types/node": "^18.0.3", | ||
"@types/express": "^4.17.15", | ||
"@types/node": "^20.0.0", | ||
"rimraf": "^5.0.1", | ||
"ts-node-dev": "^2.0.0", | ||
"typescript": "^4.7.4" | ||
"typescript": "^5.0.0" | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"lib": ["ES2015"], | ||
"target": "es5", | ||
"compilerOptions": { | ||
"lib": ["ES2015"], | ||
"target": "es5", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": false, | ||
"outDir": "dist", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true | ||
} | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": false, | ||
"outDir": "dist", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true | ||
}, | ||
"exclude": ["node_modules", "dist", "test", "src/**/*.spec.ts"] | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59837
15
1202
6
5
6
5
+ Addedexpress@^4.18.2
+ Addedhttp-proxy-middleware@^2.0.6
+ Added@types/http-proxy@1.17.15(transitive)
+ Added@types/node@22.9.3(transitive)
+ Addedaccepts@1.3.8(transitive)
+ Addedagent-base@7.1.1(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcommander@11.1.0(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.7.1(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedexpress@4.21.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-proxy@1.18.1(transitive)
+ Addedhttp-proxy-middleware@2.0.7(transitive)
+ Addedhttps-proxy-agent@7.0.5(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-obj@3.0.0(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedms@2.0.0(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.10(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedcommander@9.5.0(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
Updatedcommander@^11.0.0
Updatedhttps-proxy-agent@^7.0.0