robbie-cahill / tunnelmole-client Goto Github PK
View Code? Open in Web Editor NEWTunnelmole - Connect to local servers from anywhere
License: MIT License
Tunnelmole - Connect to local servers from anywhere
License: MIT License
It is unable to do some work compare to ngrok
$ cat /etc/os-release
PRETTY_NAME="Pop!_OS 22.04 LTS"
$ node --version
v18.15.0
$ yarn tunnelmole -V
2.1.10
$ yarn next --version
Next.js v12.3.4
yarn add tunnelmole
yarn next dev & yarn tunnelmole 3000
Socket connection to 'wss://qmwe6k-ip-xx-xx-xx-xxx.tunnelmole.com/_next/webpack-hmr' failed: Error during WebSocket handshake: Unexpected response code: 404
I want to know if there is any way to serve the server for a long time, and just disconnect manually.
I installed tunnelmole via NPM and get this error every time I try to run it.
TypeError: program.name(...).usage is not a function
at run (file:///C:/Users/user/AppData/Roaming/npm/node_modules/tunnelmole/bin/tunnelmole.ts:29:10)
at file:///C:/Users/user/AppData/Roaming/npm/node_modules/tunnelmole/bin/tunnelmole.ts:56:11
at file:///C:/Users/user/AppData/Roaming/npm/node_modules/tunnelmole/bin/tunnelmole.ts:57:3
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
I have Node v19.8.1 and NPM 9.6.4.
Why would I would I purchase a subscription to a permanent URL address, if I can't even rely on the trial url to not constantly reset? The entire reason to self-host is bypassing the issues inhrent to text and other media hosted here.
I basically had to upload my video here with a 25MB limit ( a limit almost all modern YT videos go past ), and then plug it into my self-hosted site.
Very nice component - and I like the way you can get multiple generated internet SSL URLs.
I was trying to use it for a code example that demonstrated a tricky mobile security use case.
In ngrok you can write the following type of script to spin up a URL and then use the URL value in automation.
For example to configure components that use the URLs.
A similar feature in your component would also add to its appeal, so thought I'd add a request for that.
ngrok http 80 --log=stdout &
sleep 5
GENERATED_URL=$(curl -s http://localhost:4040/api/tunnels | jq -r '.tunnels[] | select(.proto == "https") | .public_url')
Nothing urgent though - for now I'm writing some script which seems to work alright:
tmole 3000 >mobile_hostnames &
tmole 3001 >web_hostnames &
tmole 8443 >authorization_server_hostnames &
sleep 5
MOBILE_BASE_URL=$(tail -n 1 mobile_hostnames | cut -d " " -f1)
WEB_BASE_URL=$(tail -n 1 web_hostnames | cut -d " " -f1)
AUTHORIZATION_SERVER_BASE_URL=$(tail -n 1 authorization_server_hostnames | cut -d " " -f1)
I'm using the npm tunnel mole client.
using this command:
npm install -g @thgh/tunnelmole && npx tunnelmole --set-api-key 123456789 && npx tunnelmole 32400 as sudomain.website.com
The service I'm proxying is Plex media server. After logging into my plex media server and redirected to home page, the client will just randomly crash.
/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/sender.js:116
keen_frances-localtunnel-1 | throw new TypeError('First argument must be a valid error code number');
keen_frances-localtunnel-1 | ^
keen_frances-localtunnel-1 | TypeError: First argument must be a valid error code number
keen_frances-localtunnel-1 | at Sender.close (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/sender.js:116:13)
keen_frances-localtunnel-1 | at HostipWebSocket.close (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/websocket.js:287:18)
keen_frances-localtunnel-1 | at WebSocketCloseMessage (file:///usr/local/lib/node_modules/@thgh/tunnelmole/message-handlers.ts:28:38)
keen_frances-localtunnel-1 | at HostipWebSocket. (file:///usr/local/lib/node_modules/@thgh/tunnelmole/src/tunnelmole.ts:98:9)
keen_frances-localtunnel-1 | at HostipWebSocket.emit (node:events:526:35)
keen_frances-localtunnel-1 | at Receiver.receiverOnMessage (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/websocket.js:1068:20)
keen_frances-localtunnel-1 | at Receiver.emit (node:events:514:28)
keen_frances-localtunnel-1 | at Receiver.dataMessage (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/receiver.js:517:14)
keen_frances-localtunnel-1 | at Receiver.getData (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/receiver.js:435:17)
keen_frances-localtunnel-1 | at Receiver.startLoop (/usr/local/lib/node_modules/@thgh/tunnelmole/node_modules/ws/lib/receiver.js:143:22)
any idea why this is happening?
Hi, after trying in mac:
curl -s https://tunnelmole.com/sh/install-mac.sh --output install-mac.sh && sudo bash install-mac.sh
tmole 3000
with a React instance running on 192.168.0.50:3000, gets no output, stuck in tmole 3000
.
Same in Ubuntu:
curl -s https://tunnelmole.com/sh/install-linux.sh | sudo bash
tmole 3001
running another instance of react in a different machine. Am I doing something wrong? Thanks
504 Gateway Time-out
nginx/1.17.9
I double checked to make sure the port number is absolutely right
this same error is also happening to localtunnel
Hey,
i tried to run "tmole 3000".
I get following Error:
FetchError: request to https://service.tunnelmole.com/tunnelmole-log-telemetry failed, reason: connect ECONNREFUSED 157.245.179.192:443
If i try to call 157.245.179.192:443 in my browser i get "SSL error: certificate has expired". So my company might block because of a expired certificate.
Is there a way to fix this?
I have linux-x64
node-v18.17.1
on the Windows Subsystem for Linux version 2
PORT=8080 node dist/server/entry.js &
sudo npm install -g tunnelmole
tunnelmole 8080
I also tried $ sudo tunnelmole 8080
, and server on HOST=0.0.0.0
all error
/usr/lib/node_modules/tunnelmole/node_modules/node-fetch/lib/index.js:1501
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
^
FetchError: request to http://localhost:8001/tunnelmole-log-telemetry failed, reason: connect ECONNREFUSED 127.0.0.1:8001
at ClientRequest.<anonymous> (/usr/lib/node_modules/tunnelmole/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:514:28)
at Socket.socketErrorListener (node:_http_client:501:9)
at Socket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
$ cat /etc/os-release
PRETTY_NAME="Pop!_OS 22.04 LTS"
$ node --version
v18.15.0
$ yarn tunnelmole -V
2.1.10
$ yarn next --version
Next.js v12.3.4
yarn add tunnelmole
yarn next dev & yarn tunnelmole 3000
yarn build && yarn start & yarn tunnelmole 3000
My app is only accessible on 0.0.0.0
.
It works fine on ngrok if I use this host but I can't seem to be able to do the same with tunnelmole.
I have been testing tunnelmole with the NPM module tunnelmole
OS - Ubuntu
NodeJs - 18.16.1
Code
import { tunnelmole } from 'tunnelmole';
const url = await tunnelmole({
port: 3000
});
Error
Error: connect ECONNREFUSED 127.0.0.1:8081
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8081
}
I'd like to know if it's possible to use Tunnelmole to connect to SSH. If not, I'd like to suggest this feature.
If we tunnel our port 22, we get both the http and https tunnelmole links
If we try to connect, such as with:
ssh user@<tunnelmole url>
We get this error:
user@<tunnelmole url>: Permission denied (publickey)
any documentation to use our custom domain?
npx tunnelmole 8080
will just work automatically with latest nodejs runtime
Can you please update the instructions of uninstallation in the readme.
I am trying to build tunnelmole-service and tunnelmole-client on my local Windows Server 2022 machine. I have node 20.11.0 and TypeScript 5.3.3.
The tunnelmode-service builds without any problem. However, the tunnelmole-client fails during "npm install". I do have the latest code downloaded. I have attached log file. Can you please help me understand what is going on?
Thanks!
Hey @robbie-cahill ! Thank you for the library, it has been working well for us over the last several weeks.
However, today, tunnelmole seems to be hanging via the CLI, similar to #1 :
max ~ $ tmole -V
2.2.5
max ~ $ tmole 3030
// hangs, no output
as well as programatically:
const url = await tunnelmole({
port: 3030
});
I have asked others to try it, and it is the same issue, whether that's on Linux, or Mac (M1/M2). No VPN/firewalls.
Is there a way to get debug logs to help with troubleshooting?
Thanks!
I'm starting tunnelmole
in Node. It looks that by default it prints out the URLs to the console:
http://foo-ip-99-115-121-181.tunnelmole.net is forwarding to localhost:xxx
https://foo-ip-99-115-121-181.tunnelmole.net is forwarding to localhost:xxx
I can't find a way to silence these logs. Is there a way to silence them? I'm exploring using this in the context of CI tests, where the extra logging can become noisy and distract from diagnosing test failures.
Also, the output of tunnelmole
appears to be the https
url:
const httpsURL = await tunnelmole({
port: 55720
});
I imagine this may be a much larger design ask, but I wonder if it would be helpful to also return the http
link, or, failing that, simply return the non http
portion of the URL (i.e., foo-ip-98-116-111-185.tunnelmole.net
)
is run build supposed to build the client executable?
if not what is the correct process to creating the node.exe for standalone usage
When developing tunnelmole, the client stops when the server restarts. The client could try to reconnect.
As the title described, the service isn't working properly.
I can't access my web service with the generated URL, it keeps showing up [504 Gateway Time-out / nginx/1.18.0 (Ubuntu)]
I just bought the Lite plan and hope this issues can be fixed soon!
Thanks~
After adding eslint, there are a few errors based on the default recommended coding standards.
> [email protected] lint
> eslint . --ext .ts
/home/robbie/projects/tunnelmole-client/src/cli/dispatch-command.ts
3:10 warning 'setApiKey' is defined but never used @typescript-eslint/no-unused-vars
10:54 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/message-handlers/forwarded-request.ts
37:13 error Do not use "@ts-ignore" because it alters compilation errors @typescript-eslint/ban-ts-comment
58:34 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/message-handlers/generic-message-handler.ts
7:53 warning 'message' is defined but never used @typescript-eslint/no-unused-vars
7:62 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
7:67 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
7:95 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
7:113 error Unexpected empty async function 'genericMessageHandler' @typescript-eslint/no-empty-function
/home/robbie/projects/tunnelmole-client/src/message-handlers/hostname-already-taken.ts
4:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
4:66 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
4:94 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/src/message-handlers/invalid-subscription.ts
5:82 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
5:110 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/src/messages/forwarded-request-message.ts
7:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
8:11 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/messages/forwarded-response-message.ts
8:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/tunnelmole.ts
101:34 warning 'reject' is defined but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/src/websocket/host-ip-websocket.ts
5:26 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/test/integration/test-server/app.ts
6:7 warning 'port' is assigned a value but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/test/integration/tunnelmole.test.ts
20:37 warning 'reject' is defined but never used @typescript-eslint/no-unused-vars
73:13 error Do not use "@ts-ignore" because it alters compilation errors @typescript-eslint/ban-ts-comment
โ 22 problems (3 errors, 19 warnings)
I'll get around to these at some point, but PRs are welcome.
I'm seeing the following error on 2.2.8
when starting a tunnel:
1700274107834Caught an error:
AggregateError:
at internalConnectMultiple (node:net:1114:18)
at afterConnectMultiple (node:net:1667:5) {
code: 'ECONNREFUSED',
[errors]: [
Error: connect ECONNREFUSED ::1:8081
at createConnectionError (node:net:1634:14)
at afterConnectMultiple (node:net:1664:40) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 8081
},
Error: connect ECONNREFUSED 127.0.0.1:8081
at createConnectionError (node:net:1634:14)
at afterConnectMultiple (node:net:1664:40) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8081
}
]
}
The local server is reachable at localhost:<port>
.
Hello, I have tried installing tunnelmole client as a global package (like this). After trying to execute the tool, I got the following error:
> tmole 3000
node:fs:585
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, open 'D:\/package.json'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at file:///D:/Programs/Development/NodeVersionManager/v16.16.0/node_modules/tunnelmole/dist/src/node/packageJson.js:3:35
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async loadESM (node:internal/process/esm_loader:88:5)
at async handleMainPromise (node:internal/modules/run_main:61:12) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'D:\\/package.json'
}
I am using Windows 10, and ran the script from a Windows PS terminal while I was in a random folder (root of my secondary drive).
It seems like the tmole
client expects the existence of package.json
in a directory where it is being run.
const { name, version } = packageJson;
program
.name(name)
.usage(...)
...
Why does it require the existence of the JSON file? Or is this unintended and should extract name
and version
from the package.json
located in the tunnelmole/dist
?
Thanks for clarification!
tmole xxxx
Fails to start because the certificate on wildcard subdomains is expired.
One of the failing URLs: https://service.tunnelmole.com/tunnelmole-log-telemetry
Even skipping telemetry with the env variable does not work around the issue. I guess there are other subdomains affected.
tunnelmole-client git:(main) npm run lint
> [email protected] lint
> eslint . --ext .ts
/home/robbie/projects/tunnelmole-client/src/cli/dispatch-command.ts
3:10 warning 'setApiKey' is defined but never used @typescript-eslint/no-unused-vars
10:54 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/message-handlers/forwarded-request.ts
37:13 error Do not use "@ts-ignore" because it alters compilation errors @typescript-eslint/ban-ts-comment
58:34 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/home/robbie/projects/tunnelmole-client/src/message-handlers/generic-message-handler.ts
7:53 warning 'message' is defined but never used @typescript-eslint/no-unused-vars
7:62 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
7:67 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
7:95 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
7:113 error Unexpected empty async function 'genericMessageHandler' @typescript-eslint/no-empty-function
/home/robbie/projects/tunnelmole-client/src/message-handlers/hostname-already-taken.ts
4:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
4:66 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
4:94 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/src/message-handlers/invalid-subscription.ts
5:82 warning 'websocket' is defined but never used @typescript-eslint/no-unused-vars
5:110 warning 'options' is defined but never used @typescript-eslint/no-unused-vars
/home/robbie/projects/tunnelmole-client/src/messages/forwarded-response-message.ts
8:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
Does tunnelmole support WebSockets? If so, how could I run my own private server with tunnelmole? Thanks in advance.
Hi,
I was observing some pretty strange behavior. All my get requests come through, but when I do a post request to a specific URL, then it also works. But the second post request to the same URL suddenly gets transformed into a get request?
Is it possible to tunnel TCP sockets and not just http ?
When I try to expose a port I get:
504 Gateway timeout
Currently Tunnelmole subdomains only belong to clients for as long as the connection is open.
Associate API keys with subdomains so that once an API key reserves a subdomain, another API key can't use that subdomain unless they unreserve it.
Hi @robbie-cahill, looks like recently the limit of connections for free users has been capped at 1. Should this be clarified in the README?
Hello:) Trying to run tunnelmole on a Jetson Nano Developper Kit running Ubuntu 18.04. Seems to be because binary is compiled for x86 and no binary is provided for ARM. Could it ?
Getting the following error :
user@pathtoserver:/usr/local/bin$ tmole 8888
-bash: /usr/local/bin/tmole: cannot execute binary file: Exec format error
Upon cding into tmole.exe and attempting to get a random public URL forwarding to a specific port, after I press the enter key, the text cursor leaves focus and no output shows. Re-entering the command leads to the same result. See attached image below for more information.
tmole version: 1.0
Windows 11
Command Prompt (administrator)
Installed via Github/npm
Expectation:
tmole.exe is supposed to send outputs in the console after the enter key is pressed, this information includes critical information for port forwarding.
**Reality: **
tmole.exe shows no outputs upon pressing the enter key whatsoever, leaves command bar focus and does nothing.
Troubleshooting:
I asked a friend to attempt to reproduce the issue, and he was unable to reproduce the bug as he was able to port-forward successfully, so what am I doing wrong here? It should be easier to operate the software than this. Any assistance and/or bug fixes would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.