Commit 34ded91c authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Always listen on port 80

parent daad343e
Loading
Loading
Loading
Loading
+24 −21
Original line number Diff line number Diff line
@@ -33,9 +33,12 @@ if [[ "$2" != "/"* ]]; then
  HTML=$(html "$BODY")
  printf '%b' "HTTP/1.1 200 OK\nContent-Length: ${#HTML}\nConnection: close\n\n$HTML" > "$TMP_FILE"

  socat TCP4-LISTEN:80,reuseaddr,fork,crlf SYSTEM:"cat ${TMP_FILE}" 2> /dev/null &
  socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"cat ${TMP_FILE}" 2> /dev/null & wait $!
  
else
  exit
  
fi

if [[ "$2" != "/run/ip.sh" ]]; then

@@ -60,6 +63,6 @@ else
fi

chmod +x "$TMP_FILE"
  socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"$TMP_FILE" 2> /dev/null & wait $!
  
fi
socat TCP4-LISTEN:80,reuseaddr,fork,crlf SYSTEM:"$TMP_FILE" 2> /dev/null &
socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"$TMP_FILE" 2> /dev/null & wait $!