Created
June 24, 2024 14:06
-
-
Save jikkuatwork/bd27a8725f928134db5e216453f567b8 to your computer and use it in GitHub Desktop.
Expose local ports to Internet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function expose() { | |
if [[ -z "$1" ]]; then | |
echo "Error: No port specified." | |
return 1 # Exit the function with an error status | |
fi | |
local port=$1 | |
ssh -R 80:localhost:${port} [email protected] 2>&1 | awk '/https:\/\/[a-zA-Z0-9]+\.lhr\.life/ {print $NF; fflush(); exit}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment