Giter Site home page Giter Site logo

tunnelmole-client's Issues

Important

It is unable to do some work compare to ngrok

  1. It not able to fully server novnc from private localport to tunnelmole subdomain .
  • it show the no vnc page , but when we try to move forward in it to open something then the novnc on tmole subdomin show it not connected to backed server.
  • please developed that .
  • where as in ngrok it will easily happend.
  1. Where as ngrok do it .

Next.js (webpack) hot module reloading does not work

software versions

$ 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

repro

  1. yarn add tunnelmole
  2. yarn next dev & yarn tunnelmole 3000
    ER/AR: tunnel seems to work, the Next.js app loads in browser
  3. Make some arbitrary templating change (copy, remove a block of content, etc)
    ER: the tunneled app should update without a reload
    AR: tunneled app does not update until page is reloaded
    AR: Browser console error:

    Socket connection to 'wss://qmwe6k-ip-xx-xx-xx-xxx.tunnelmole.com/_next/webpack-hmr' failed: Error during WebSocket handshake: Unexpected response code: 404

TypeError on Run

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.

Tunnel Going In And Out

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.

Allow the user to get the generated URL

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)

Tunnel mole stuck

I am using tunnel mole to forward my server running at port 4000 but the forwarding links are not showing. Please refer to the image below. It gets stuck here.
Screenshot from 2024-05-15 13-53-21

Client keeps crashing

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?

No outup after tmole <port>

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

Not working in WSL

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)

Next.js web server unresponsive, results in 504 gateway timeout

software versions

$ 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

repro

  1. yarn add tunnelmole
  2. yarn next dev & yarn tunnelmole 3000
    ER/AR: tunnel seems to work, the Next.js app loads in browser
  3. yarn build && yarn start & yarn tunnelmole 3000
    AR: Next.js app never loads in browser, eventually 504 gateway timeout

Support other hosts than localhost

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.

Error: connect ECONNREFUSED 127.0.0.1:8081

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
}

Tunnel TCP connection (so we can expose SSH)

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)

Uninstallation

Can you please update the instructions of uninstallation in the readme.

Can't build tunnelmode-client on Windows.

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!

2024-01-18T19_25_08_117Z-debug-0.log

Hanging via CLI as well as programatically

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!

Is there a way to silence logs in the Node package?

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)

npm run build

is run build supposed to build the client executable?

if not what is the correct process to creating the node.exe for standalone usage

Automatic reconnect

When developing tunnelmole, the client stops when the server restarts. The client could try to reconnect.

Python FastAPI not working

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~

The terminal looks fine.
image
But the URL is not working.
image

Fixing eslint errors

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.

Unable to start a tunnel (2.2.8)

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>.

Using tmole as globally installed package

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.

(source)

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!

Certificate expired on *.tunnelmole.com

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.

Some more eslint errors

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

WebSockets

Does tunnelmole support WebSockets? If so, how could I run my own private server with tunnelmole? Thanks in advance.

Reserved domains

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.

ARM support ?

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

tmole.exe shows no output in cmd

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

image

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 tried running cmd through admin.
  • I tried various different ports.
  • I tried other commands of tmole, those showed up properly.
  • I tried resetting all network adapters.
  • I tried reinstalling the software.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.