Created
July 24, 2024 16:04
-
-
Save fl64/3448e625905e89e844de18340796541c to your computer and use it in GitHub Desktop.
bash http server
This file contains 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
#!/bin/bash | |
data=$(date $T) | |
echo "content-type: text/plain" | |
echo "content-length: $(echo ${data} | wc -c)" | |
echo | |
echo ${data} |
This file contains 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
#!/bin/bash | |
while true; do | |
{ echo -ne "HTTP/1.1 200 OK\r\n"; sh data.sh; } | nc -l -k -q 1 8080; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment