tunnelmole
Advanced tools
Comparing version 2.3.5 to 2.3.6
import { eventHandler, URL_ASSIGNED } from '../events/event-handler.js'; | ||
import chalk from 'chalk'; | ||
export default async function hostnameAssigned(message, websocket, options) { | ||
@@ -7,7 +8,12 @@ const port = options.port; | ||
} | ||
const httpsUrl = `https://${message.hostname}`; | ||
const httpUrl = `http://${message.hostname}`; | ||
const httpsUrl = `https://${message.hostname}`; | ||
const destinationUrl = `http://localhost:${port}`; | ||
if (process.env.TUNNELMOLE_QUIET_MODE !== '1') { | ||
console.info(`${httpUrl} is forwarding to localhost:${port}`); | ||
console.info(`${httpsUrl} is forwarding to localhost:${port}`); | ||
console.info('='.repeat(process.stdout.columns)); | ||
console.info('Your URLs are below. Always use HTTPs for the best security'); | ||
console.info(''); | ||
console.info(`${chalk.greenBright.bold(httpsUrl)} ⟶ ${chalk.bold(destinationUrl)}`); | ||
console.info(`${chalk.greenBright.bold(httpUrl)} ⟶ ${chalk.bold(destinationUrl)}`); | ||
console.info('='.repeat(process.stdout.columns)); | ||
} | ||
@@ -14,0 +20,0 @@ eventHandler.emit(URL_ASSIGNED, httpsUrl); |
@@ -8,2 +8,3 @@ import { initialiseClientId } from './identity/client-id-service.js'; | ||
import detectPort from 'detect-port'; | ||
import chalk from 'chalk'; | ||
export default async function tunnelmole(options, isCli = false) { | ||
@@ -24,5 +25,3 @@ await initStorage(); | ||
console.warn(` | ||
Warning: You currently don't have anything running on port ${port}, which means you might get the standard 503 gateway timeout error when you make a request, since your service is not reachable. | ||
Please start your service on port ${port} so that requests can reach your service. | ||
${chalk.yellow.bold(`You currently don't have anything running on port ${port}`)}. Please start your service on port ${chalk.bold(port)} so that requests can reach your service. You may have also chosen the wrong port, in which case, find out what port your service is actually running on. | ||
`); | ||
@@ -29,0 +28,0 @@ } |
@@ -1,2 +0,2 @@ | ||
declare const version = "2.3.5"; | ||
declare const version = "2.3.6"; | ||
export { version }; |
@@ -1,3 +0,3 @@ | ||
const version = '2.3.5'; | ||
const version = '2.3.6'; | ||
export { version }; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "tunnelmole", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"description": "Tunnelmole, an open source ngrok alternative. Instant public URLs for any http/https based application. Available as a command line application or as an NPM dependency for your code. Stable and maintained. Good test coverage. Works behind firewalls", | ||
@@ -67,2 +67,3 @@ "main": "dist/src/index.js", | ||
"commander": "^5.1.0", | ||
"chalk": "4.1.2", | ||
"deep-equal": "^2.0.3", | ||
@@ -78,3 +79,3 @@ "deepmerge": "^4.2.2", | ||
"toml": "^3.0.0", | ||
"tunnelmole": "^2.1.5", | ||
"tunnelmole": "^2.1.6", | ||
"validator": "^13.0.0", | ||
@@ -81,0 +82,0 @@ "ws": "^7.2.5" |
@@ -5,2 +5,3 @@ import HostnameAssignedMessage from '../messages/hostname-assigned-message.js'; | ||
import { eventHandler, URL_ASSIGNED } from '../events/event-handler.js'; | ||
import chalk from 'chalk'; | ||
@@ -14,9 +15,14 @@ export default async function hostnameAssigned(message: HostnameAssignedMessage, websocket: HostipWebSocket, options: Options) { | ||
const httpsUrl = `https://${message.hostname}`; | ||
const httpUrl = `http://${message.hostname}`; | ||
const httpsUrl = `https://${message.hostname}`; | ||
const destinationUrl = `http://localhost:${port}`; | ||
if (process.env.TUNNELMOLE_QUIET_MODE !== '1') { | ||
console.info(`${httpUrl} is forwarding to localhost:${port}`); | ||
console.info(`${httpsUrl} is forwarding to localhost:${port}`); | ||
console.info('='.repeat(process.stdout.columns)); | ||
console.info('Your URLs are below. Always use HTTPs for the best security'); | ||
console.info(''); | ||
console.info(`${chalk.greenBright.bold(httpsUrl)} ⟶ ${chalk.bold(destinationUrl)}`); | ||
console.info(`${chalk.greenBright.bold(httpUrl)} ⟶ ${chalk.bold(destinationUrl)}`); | ||
console.info('='.repeat(process.stdout.columns)); | ||
} | ||
@@ -23,0 +29,0 @@ |
@@ -9,2 +9,3 @@ import { initialiseClientId } from './identity/client-id-service.js'; | ||
import detectPort from 'detect-port'; | ||
import chalk from 'chalk'; | ||
@@ -34,5 +35,3 @@ export default async function tunnelmole( | ||
` | ||
Warning: You currently don't have anything running on port ${port}, which means you might get the standard 503 gateway timeout error when you make a request, since your service is not reachable. | ||
Please start your service on port ${port} so that requests can reach your service. | ||
${chalk.yellow.bold(`You currently don't have anything running on port ${port}`)}. Please start your service on port ${chalk.bold(port)} so that requests can reach your service. You may have also chosen the wrong port, in which case, find out what port your service is actually running on. | ||
` | ||
@@ -39,0 +38,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
113815
1730
25
+ Addedchalk@4.1.2
Updatedtunnelmole@^2.1.6