Compare commits
6 Commits
42928444aa
...
cdfe4c4fc8
Author | SHA1 | Date | |
---|---|---|---|
cdfe4c4fc8 | |||
6d1a2fdc39 | |||
|
0aa31874f2 | ||
|
c8b8717d7a | ||
|
81a414e503 | ||
|
21e33bc179 |
@ -1,3 +1,8 @@
|
|||||||
|
### 11/11/2022
|
||||||
|
|
||||||
|
- Fixed axios is not a function
|
||||||
|
- Add generate token with data (clientId, apiKey) to server
|
||||||
|
|
||||||
### 20/10/2022
|
### 20/10/2022
|
||||||
|
|
||||||
- Upgraded packages and fixed some bugs
|
- Upgraded packages and fixed some bugs
|
||||||
|
20
README.md
20
README.md
@ -9,7 +9,7 @@ npm i -g @cubetiq/hlt
|
|||||||
|
|
||||||
OR
|
OR
|
||||||
|
|
||||||
npx @cubetiq/hlt
|
npx -y @cubetiq/hlt
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -25,15 +25,15 @@ hlt [command] [options]
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Initialize a client and token for connect (default's profile)
|
# Initialize a client and token for connect (default's profile)
|
||||||
npx @cubetiq/hlt init
|
npx -y @cubetiq/hlt init
|
||||||
|
|
||||||
# Start port 3000 to remote server
|
# Start port 3000 to remote server
|
||||||
npx @cubetiq/hlt start 3000
|
npx -y @cubetiq/hlt start 3000
|
||||||
```
|
```
|
||||||
|
|
||||||
# Start port 3000 with suffix to remote server
|
# Start port 3000 with suffix to remote server
|
||||||
|
|
||||||
npx @cubetiq/hlt start 3000 -s mytest
|
npx -y @cubetiq/hlt start 3000 -s mytest
|
||||||
|
|
||||||
````
|
````
|
||||||
|
|
||||||
@ -41,10 +41,10 @@ npx @cubetiq/hlt start 3000 -s mytest
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Initialize a client and token for connect (mytest's profile)
|
# Initialize a client and token for connect (mytest's profile)
|
||||||
npx @cubetiq/hlt init -p mytest
|
npx -y @cubetiq/hlt init -p mytest
|
||||||
|
|
||||||
# Start port 3000 to remote server (mytest's profile)
|
# Start port 3000 to remote server (mytest's profile)
|
||||||
npx @cubetiq/hlt start 3000 -p mytest
|
npx -y @cubetiq/hlt start 3000 -p mytest
|
||||||
````
|
````
|
||||||
|
|
||||||
### Custom Config
|
### Custom Config
|
||||||
@ -52,25 +52,25 @@ npx @cubetiq/hlt start 3000 -p mytest
|
|||||||
- Generate Client Key
|
- Generate Client Key
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npx @cubetiq/hlt config client new
|
npx -y @cubetiq/hlt config client new
|
||||||
```
|
```
|
||||||
|
|
||||||
- Set Client Token (Required, contact to vendor)
|
- Set Client Token (Required, contact to vendor)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npx @cubetiq/hlt config token $TOKEN
|
npx -y @cubetiq/hlt config token $TOKEN
|
||||||
```
|
```
|
||||||
|
|
||||||
- Set Custom Server
|
- Set Custom Server
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npx @cubetiq/hlt config server https://lt.ctdn.net
|
npx -y @cubetiq/hlt config server https://lt.ctdn.net
|
||||||
```
|
```
|
||||||
|
|
||||||
- Start Client
|
- Start Client
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npx @cubetiq/hlt start $YOUR_PORT
|
npx -y @cubetiq/hlt start $YOUR_PORT
|
||||||
```
|
```
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@cubetiq/hlt",
|
"name": "@cubetiq/hlt",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@cubetiq/hlt",
|
"name": "@cubetiq/hlt",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.0.0",
|
"axios": "^1.0.0",
|
||||||
@ -90,9 +90,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "18.11.2",
|
"version": "18.11.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
||||||
"integrity": "sha512-BWN3M23gLO2jVG8g/XHIRFWiiV4/GckeFIqbU/C4V3xpoBBWSMk4OZomouN0wCkfQFPqgZikyLr7DOYDysIkkw==",
|
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/strip-bom": {
|
"node_modules/@types/strip-bom": {
|
||||||
@ -698,9 +698,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/socket.io-parser": {
|
"node_modules/socket.io-parser": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz",
|
||||||
"integrity": "sha512-tLfmEwcEwnlQTxFB7jibL/q2+q8dlVQzj4JdRLJ/W/G1+Fu9VSxCx1Lo+n1HvXxKnM//dUuD0xgiA7tQf57Vng==",
|
"integrity": "sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@socket.io/component-emitter": "~3.1.0",
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
"debug": "~4.3.1"
|
"debug": "~4.3.1"
|
||||||
@ -1002,9 +1002,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "18.11.2",
|
"version": "18.11.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
||||||
"integrity": "sha512-BWN3M23gLO2jVG8g/XHIRFWiiV4/GckeFIqbU/C4V3xpoBBWSMk4OZomouN0wCkfQFPqgZikyLr7DOYDysIkkw==",
|
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/strip-bom": {
|
"@types/strip-bom": {
|
||||||
@ -1456,9 +1456,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"socket.io-parser": {
|
"socket.io-parser": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.1.tgz",
|
||||||
"integrity": "sha512-tLfmEwcEwnlQTxFB7jibL/q2+q8dlVQzj4JdRLJ/W/G1+Fu9VSxCx1Lo+n1HvXxKnM//dUuD0xgiA7tQf57Vng==",
|
"integrity": "sha512-V4GrkLy+HeF1F/en3SpUaM+7XxYXpuMUWLGde1kSSh5nQMN4hLrbPIkD+otwh6q9R6NOQBN4AMaOZ2zVjui82g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@socket.io/component-emitter": "~3.1.0",
|
"@socket.io/component-emitter": "~3.1.0",
|
||||||
"debug": "~4.3.1"
|
"debug": "~4.3.1"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cubetiq/hlt",
|
"name": "@cubetiq/hlt",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"description": "A lightweight http tunnel client using nodejs and socket.io client",
|
"description": "A lightweight http tunnel client using nodejs and socket.io client",
|
||||||
"main": "dist/client.js",
|
"main": "dist/client.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -265,8 +265,13 @@ program
|
|||||||
|
|
||||||
if (!config.token) {
|
if (!config.token) {
|
||||||
console.log("Generating token...");
|
console.log("Generating token...");
|
||||||
await getTokenFree(config.server)
|
await getTokenFree(config.server, {
|
||||||
|
timestamp: (new Date().getTime()),
|
||||||
|
clientId: config.clientId,
|
||||||
|
apiKey: config.apiKey,
|
||||||
|
})
|
||||||
.then((resp: any) => {
|
.then((resp: any) => {
|
||||||
|
console.log("Token generated successfully!");
|
||||||
if (resp.data?.token) {
|
if (resp.data?.token) {
|
||||||
config.token = resp.data?.token;
|
config.token = resp.data?.token;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const axios = require("axios").default;
|
const axios = require("axios");
|
||||||
|
|
||||||
const getTokenFree = async (baseUrl: string, data: any = {}) => {
|
const getTokenFree = async (baseUrl: string, data: any = {}) => {
|
||||||
const url = `${baseUrl}/__free__/api/get_token`;
|
const url = `${baseUrl}/__free__/api/get_token`;
|
||||||
|
Loading…
Reference in New Issue
Block a user