0

Update local tunneling script to no longer use serveo.net

This commit is contained in:
Gabe Kangas 2024-12-09 10:37:40 -08:00
parent 4f1c1ec683
commit c24ee6202a

View File

@ -1,12 +1,18 @@
#!/bin/bash
# This script will make your local Owncast server available at a public URL.
# It's particularly useful for testing on mobile devices.
# It's particularly useful for testing on mobile devices or want to test
# activitypub integration.
PORT=8080
USERNAME=$(whoami)
BRANCH=$(git symbolic-ref --short -q HEAD | sed 's/[^a-z A-Z 0-9]//g')
HOSTNAME="oc-$USERNAME-$BRANCH"
HOST="localhost"
echo "Please wait. Making the local server port $PORT available at https://$HOSTNAME.serveo.net"
ssh -R "$HOSTNAME".serveo.net:80:localhost:$PORT serveo.net
# Using nc (netcat) to check if the port is open
if nc -zv $HOST $PORT 2>/dev/null; then
echo "Your web server is running on port $PORT. Good."
else
echo "Please make sure your Owncast server is running on port $PORT."
exit 1
fi
ssh -R 80:localhost:$PORT localhost.run