Here's my small webserver:
#!/bin/bash
while : ; do cat conference.txt | nc -l 80; done
Here's the story behind it: #!/bin/bash
while : ; do cat conference.txt | nc -l 80; done
Here's the story behind it:Two comments:
- using "ping -a" creates an audible ping so you can find the server if you're by yourself without having to look at the screen.
- No need for cat:
while :; do nc -l 80 < conference.txt; done $ ping -a 127.0.0.1 | less
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.029 ms^G
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.023 ms^G
Looks like you need a terminal that has a BEL sound.Edit: Uhm, right. I have also silenced all system sounds in Windows.
Why does firefox shows the "chose an application to open this link" when you access the http://localhost link, but shows the content correctly when you access the 127.0.0.1/0.0.0.0 ip-based version?
HTTP/1.1 200
Content-Type: text/plan;
1st line of content