Long-running Persistent Tunnels
You can use Pinggy to host websites, apps, and files from localhost just like any server. You just need to ensure the following:
Get a persistent subdomain or a custom domain from the dashboard.
To generate an SSH key, run the following command in your terminal and press Enter:
Press Enter to save the key in the default location, optionally add a passphrase by typing it and pressing Enter, and continue pressing Enter for any additional prompts until the command finishes.
Use the token to start the tunnel as described next.
The following command ensures that your tunnels stay alive and restart on its own if something goes wrong:
Pinggy CLI has auto reconnection built in. Download the Pinggy CLI from here and run the following command:
./pinggy -p 443 -R0:localhost:8000 <token>@pro.pinggy.io
In Mac OS or Linux, use the following script to enable auto reconnection.
# pinggy.sh
while true;
do ssh -p 443 -o ServerAliveInterval=60 -R0:localhost:8000 <token>@pro.pinggy.io;
sleep 2;
done
For Windows, use the following script:
# pinggy.bat
FOR /L %N IN () DO ssh -p 443 -o ServerAliveInterval=60 -R0:localhost:8000 <token>@pro.pinggy.io
Replace 8000 with the port you want to share, and token with your tunnel token.