tunnelmole
Advanced tools
Comparing version 2.0.13 to 2.0.14
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
import dispatchCommand from '../src/cli/dispatch-command.js'; | ||
const VERSION = '2.0.13'; | ||
const VERSION = '2.0.14'; | ||
async function run() { | ||
@@ -10,0 +10,0 @@ program |
@@ -0,1 +1,2 @@ | ||
import { eventHandler, URL_ASSIGNED } from '../events/event-handler.js'; | ||
export default async function hostnameAssigned(message, websocket, options) { | ||
@@ -6,5 +7,8 @@ const port = options.port; | ||
} | ||
console.info("http://" + message.hostname + " is forwarding to localhost:" + port); | ||
console.info("https://" + message.hostname + " is forwarding to localhost:" + port); | ||
const httpUrl = `http://${message.hostname}`; | ||
const httpsUrl = `https://${message.hostname}`; | ||
console.info(`${httpUrl} is forwarding to localhost:${port}`); | ||
console.info(`${httpsUrl} is forwarding to localhost:${port}`); | ||
eventHandler.emit(URL_ASSIGNED, httpsUrl); | ||
} | ||
//# sourceMappingURL=hostname-assigned.js.map |
import { Options } from './options.js'; | ||
export default function tunnelmole(options: Options): Promise<void>; | ||
export default function tunnelmole(options: Options): Promise<string>; |
@@ -10,2 +10,3 @@ import config from '../config.js'; | ||
import { initStorage } from './node-persist/storage.js'; | ||
import { eventHandler, URL_ASSIGNED } from './events/event-handler.js'; | ||
export default async function tunnelmole(options) { | ||
@@ -78,3 +79,9 @@ await initStorage(); | ||
}); | ||
// Listen for the URL assigned event and return it | ||
return new Promise((resolve, reject) => { | ||
eventHandler.on(URL_ASSIGNED, (url) => { | ||
resolve(url); | ||
}); | ||
}); | ||
} | ||
//# sourceMappingURL=tunnelmole.js.map |
{ | ||
"name": "tunnelmole", | ||
"version": "2.0.13", | ||
"version": "2.0.14", | ||
"description": "Tunnelmole, an open source ngrok alternative", | ||
@@ -34,3 +34,4 @@ "main": "dist/src/index.js", | ||
"watch": "tsc -p ./ -w", | ||
"start": "npm run watch & nodemon dist/src/tunnelmole.js 3000" | ||
"start": "npm run watch & nodemon dist/src/tunnelmole.js 3000", | ||
"test": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest --forceExit" | ||
}, | ||
@@ -47,3 +48,3 @@ "bin": { | ||
"@types/is-number": "^7.0.3", | ||
"@types/node": "^13.13.5", | ||
"@types/jest": "^29.5.0", | ||
"@types/node-fetch": "^2.5.7", | ||
@@ -59,2 +60,3 @@ "@types/node-localstorage": "^1.3.0", | ||
"is-number": "^7.0.0", | ||
"multer": "^1.4.5-lts.1", | ||
"nanoid": "^3.1.5", | ||
@@ -68,3 +70,10 @@ "node-fetch": "^2.6.0", | ||
"ws": "^7.2.5" | ||
}, | ||
"devDependencies": { | ||
"@types/express": "^4.17.17", | ||
"@types/multer": "^1.4.7", | ||
"@types/node": "^18.15.6", | ||
"express": "^4.18.2", | ||
"jest": "^29.5.0" | ||
} | ||
} |
import HostnameAssignedMessage from '../messages/hostname-assigned-message.js'; | ||
import HostipWebSocket from '../websocket/host-ip-websocket.js'; | ||
import { Options } from '../options.js'; | ||
import { eventHandler, URL_ASSIGNED } from '../events/event-handler.js'; | ||
@@ -12,4 +13,8 @@ export default async function hostnameAssigned(message: HostnameAssignedMessage, websocket: HostipWebSocket, options: Options) { | ||
console.info("http://" + message.hostname + " is forwarding to localhost:" + port); | ||
console.info("https://" + message.hostname + " is forwarding to localhost:" + port); | ||
const httpUrl = `http://${message.hostname}`; | ||
const httpsUrl = `https://${message.hostname}`; | ||
console.info(`${httpUrl} is forwarding to localhost:${port}`); | ||
console.info(`${httpsUrl} is forwarding to localhost:${port}`); | ||
eventHandler.emit(URL_ASSIGNED, httpsUrl); | ||
} |
@@ -12,4 +12,5 @@ import config from '../config.js'; | ||
import { initStorage } from './node-persist/storage.js'; | ||
import { eventHandler, URL_ASSIGNED } from './events/event-handler.js'; | ||
export default async function tunnelmole(options : Options) | ||
export default async function tunnelmole(options : Options): Promise<string> | ||
{ | ||
@@ -99,2 +100,9 @@ await initStorage(); | ||
}); | ||
// Listen for the URL assigned event and return it | ||
return new Promise((resolve, reject) => { | ||
eventHandler.on(URL_ASSIGNED, (url: string) => { | ||
resolve(url); | ||
}) | ||
}); | ||
} |
Sorry, the diff of this file is not supported yet
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
78682
129
1188
23
5
2
8
+ Added@types/jest@^29.5.0
+ Addedmulter@^1.4.5-lts.1
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@jest/expect-utils@29.7.0(transitive)
+ Added@jest/schemas@29.6.3(transitive)
+ Added@jest/types@29.6.3(transitive)
+ Added@sinclair/typebox@0.27.8(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Added@types/istanbul-lib-report@3.0.3(transitive)
+ Added@types/istanbul-reports@3.0.4(transitive)
+ Added@types/jest@29.5.14(transitive)
+ Added@types/node@22.10.1(transitive)
+ Added@types/stack-utils@2.0.3(transitive)
+ Added@types/yargs@17.0.33(transitive)
+ Added@types/yargs-parser@21.0.3(transitive)
+ Addedansi-styles@4.3.05.2.0(transitive)
+ Addedappend-field@1.0.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbusboy@1.6.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedci-info@3.9.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddiff-sequences@29.6.3(transitive)
+ Addedescape-string-regexp@2.0.0(transitive)
+ Addedexpect@29.7.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjest-diff@29.7.0(transitive)
+ Addedjest-get-type@29.6.3(transitive)
+ Addedjest-matcher-utils@29.7.0(transitive)
+ Addedjest-message-util@29.7.0(transitive)
+ Addedjest-util@29.7.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmulter@1.4.5-lts.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpretty-format@29.7.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreact-is@18.3.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedstack-utils@2.0.6(transitive)
+ Addedstreamsearch@1.1.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
- Removed@types/node@^13.13.5
- Removed@types/node@13.13.52(transitive)