Skip to content

Instantly share code, notes, and snippets.

@SethuSenthil
Last active September 22, 2019 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SethuSenthil/8ac6c0e1b9ab97f5c6b3fb340f9ddb24 to your computer and use it in GitHub Desktop.
Save SethuSenthil/8ac6c0e1b9ab97f5c6b3fb340f9ddb24 to your computer and use it in GitHub Desktop.
AutoSSH for serevo.net

autoServeo - AutoSSH for serevo.net

Why?

serveo.net does not support autossh and the serveralive flag will eventually fail, disconnecting you from the remote server

What does this do?

This script aims to reconnect immidieatly after your disconnected esseintaly autoSSH.

How to use

Grant permissions to the script (you will need to do this if it your first time running it) chmod +x PATH/TO/autoServeo.bash Run the script /path/to/autoServeo.bash port subdomain Port - the port you want to forword/ the port in which your local server is running -> (3000) Subdomain - the subdomain you want to request from serveo -> (coolProject) will result in your endpoint being (coolProject.serevo.com)

PORT="$1"
SUBDOMAIN="$2"
while true
do
echo "Press [CTRL+C] to stop.."
ssh -R $SUBDOMAIN:80:localhost:$PORT serveo.net -o ServerAliveInterval=60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment