It establishes a bridge between system and web for performing task on system via web.
Please follow the below instruction to install the tunnel
on target system.
With Shell:
curl -fsSL https://isurfer21.github.io/tunnel/install.sh | sh
With PowerShell:
iwr https://isurfer21.github.io/tunnel/install.ps1 -useb | iex
With Shell:
curl -fsSL https://isurfer21.github.io/tunnel/install.sh | sh -s v2.0.0
With PowerShell:
iwr https://isurfer21.github.io/tunnel/install.ps1 -useb -outf install.ps1; .\install.ps1 v2.0.0
- Download the app from releases section of the repository.
- Access it from anywhere by adding the app path in the system path.
Below mentioned switches can be shuffled based on requirement, so explore it via help
tunnel -h
Accessible on host system at default port, i.e., 9999; without credentials so it uses default credentials
tunnel
Accessible at default host & port, i.e., localhost:9999 but APIs will become accessible only using credentials
tunnel -i admin -c 123456
Accessible on all systems over network at custom port
tunnel -u 192.168.0.100 -p 8080
Serve cross-site incoming request from host system only
tunnel -x
Serve cross-site request from any systems
tunnel -x -u 192.168.0.100 -p 8080
Serve along with static site at ./
location
tunnel -d
Serve along with static site at ./app
location
tunnel -d=./app
The API Key can be generated using tunnel.genApiKey(username, password)
that can be kept separate, so as to avoid disclosing the credentials.
(function main() {
console.log('main');
let tunnel = new Tunnel();
let failure = (options, status, error) => {
console.log('[1] main.failure', status, error);
};
tunnel.login('admin', '123456');
tunnel.authenticate((result) => {
console.log('[1] main.authenticate.success', result);
tunnel.terminal('ls', (result) => {
console.log('[2] main.terminal.success', result);
}, failure);
}, failure);
}());
To directly compile and run the source code,
cd tunnel
go run tunnel.go
it will start the tunnel
To build the executable from source code,
cd tunnel
go build tunnel.go
it will create the tunnel executable file for current OS
To build the cross-platform executable from source code,
on macOS,
cd tunnel
sh build.sh
on Windows,
cd tunnel
build.bat
it will generate the tunnel executable files for all supported OS
The APIs can be tested using python3 on command-line or using an standalone html page at browser that is being served via default embedded static web server in the app.
tunnel
python3 ./test/test.py
tunnel
open http://127.0.0.1:9999/test/demo.html