I\'m trying to play around with netcat to learn more about how HTTP works. I\'d like to script some of it in bash or Perl, but I\'ve hit upon a stumbling block early on in m
You can use below netcat command to make your instance webserver:
MYIP=$(ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}') while true; do echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP" | sudo nc -l -p 80 ; done&