Merge "Make sample web server close connections"
This commit is contained in:
commit
ed755fc7eb
@ -1,6 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
MYIP=$(/sbin/ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}');
|
||||
OUTPUT_STR="Welcome to $MYIP\r"
|
||||
OUTPUT_LEN=${#OUTPUT_STR}
|
||||
|
||||
while true; do
|
||||
echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP" | sudo nc -l -p 80
|
||||
echo -e "HTTP/1.0 200 OK\r\nContent-Length: ${OUTPUT_LEN}\r\n\r\n${OUTPUT_STR}" | sudo nc -l -p 80
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user