tunnelto
tunnelto copied to clipboard
Support for stdout log
Hi,
Thank you for creating Tunneto.
I am trying to run tunnel-to inside an electron app, which will start the connection between our customer local machine and send tunnel-to link to our server, So we can download data from the local machine.
let spawn = require('child_process');
let path = "path_to_tunnel_to"
ls = spawn(path, ['--version']);
ls.stdout.on('data', (data) => {
console.log(data);
});
Output: tunnelto 0.1.12
Here in the above code it is returning the version because the process is terminated.
When I try to run
let spawn = require('child_process');
let path = "path_to_tunnel_to"
ls = spawn(path, ['--port', '3000']);
ls.stdout.on('data', (data) => {
console.log(data);
});
It will not return anything until the process is terminated. I also tried by adding verbose.
Kindly suggest any other way to do this.
In Ngrok there is option log=stdout
it will return logs in stdout. So we can process it and get URL
Then I added subdomain to the arguments, Now I know in which subdomain tunnel-to is running. But I cannot get the tunnel-to Local Inspect Dashboard URL for debugging purposes.
So if I understand correctly you want something that will write machine-readable data about the created tunnel to stdout right?
Yes correct 😀, I need a machine-readable data. Sorry for the above.
When I execute tunnelto in Node child process, I am getting the below output
Line 1
%%%%
%%%%
,,,,,,,,,,,,,,
%% ,,,%%%%%%%%%%%%%,,,
#%% ,,%%%%%,,,,,#%%%%,,
,,,,,,#%%,,,,,,, ((
.%%%#%%%%#%
%%%%#
%(%
(%%%(
(( (%%%#%%%%#
,,,,,,,,,,,,,,, %%%
,,%%%%%%,,,#%%%%%,,
%% ,,,%%%%%%%%%%%%%,,,
%%% ,,,,,,,,,,,,,,,
Line 2
=> Forwarding to localhost:4567
Local Inspect Dashboard: http://localhost:64276
Here in my logs Success! Remote tunnel created on: https://apple.tunnelto.dev
is not printing.
If I get the above line I will parse and get the tunnel URL, that's it.
Thank you so much.
Hey another quick question
When I run ./tunnelto --port 1080 --subdomain apple
⣷ Success! Remote tunnel created on: https://apple.tunnelto.dev
=> Forwarding to localhost:1080
And if I open a new tab and run the same command with different port
./tunnelto --port 3000 --subdomain apple
⣷ Success! Remote tunnel created on: https://apple.tunnelto.dev
=> Forwarding to localhost:3000
Local Inspect Dashboard: http://localhost:64628
It is returning Success!. Will it be possible to say Hey this subdomain is already taken!
if you're authenticating with a key it will overwrite that session with your new one