Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

chore(test): add support for passing custom domain and port to test script

Gabe Kangas429d8d825fda
diff --git a/test/test-local.sh b/test/test-local.sh
index 61fd12634d..f554fd3bc9 100755
--- a/test/test-local.sh
+++ b/test/test-local.sh
@@ -3,8 +3,14 @@
# This script will make your local Owncast server available at a public URL.
# It's particularly useful for testing on mobile devices or want to test
# activitypub integration.
+# Pass a custom domain as an argument if you have previously set it up at
+# localhost.run. Otherwise, a random hostname will be generated.
+# DOMAIN=me.example.com ./test/test-local.sh
+# Pass a port number as an argument if you are running Owncast on a different port.
+# By default, it will use port 8080.
+# PORT=8080 ./test/test-local.sh
-PORT=8080
+PORT="${PORT:=8080}"
HOST="localhost"
# Using nc (netcat) to check if the port is open
@@ -15,4 +21,11 @@ else
exit 1
fi
-ssh -R 80:localhost:$PORT localhost.run
+if [ -n "$DOMAIN" ]; then
+ echo "Attempting to use custom domain: $DOMAIN"
+ ssh -R $DOMAIN:80:localhost:$PORT localhost.run
+
+else
+ echo "Using auto-generated hostname for tunnel."
+ ssh -R 80:localhost:$PORT localhost.run
+fi