UNPKG

@thgh/tunnelmole

Version:

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

13 lines 626 B
import { eventHandler, URL_ASSIGNED } from '../events/event-handler.js'; export default async function hostnameAssigned(message, websocket, options) { const port = options.port; if (typeof port === 'undefined') { console.error('Please specify a port e.g. run "tmole 80"'); } 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