Unverified Commit 0b8c9516 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Loop

parent 6ee309ed
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -14,6 +14,11 @@ done

# Serve the page
HTML="<HTML><BODY><H1><CENTER>$2</CENTER></H1></BODY></HTML>"
RESPONSE="HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n$HTML\r\n"
LENGTH=$(echo "$HTML" | wc -c);

while true; do (echo -en "$RESPONSE") | timeout 1 nc -lp "${1:-8080}"; done
RESPONSE="HTTP/1.1 200 OK\nContent-Length: ${LENGTH}\nConnection: close\n\n$HTML"

while true; do 
  echo -en "$RESPONSE" | timeout 1 nc -lp "${1:-8080}"; 
  echo "loop"
done