For those of you who are interested in a tiny, safe, static file server that provides secure, public URLs from any machine (ngrok-style), I have a simple project called srvdir that will probably be useful to you: https://srvdir.net
Nweb: a tiny, safe web server (static pages only)
61–63 of 63 posts
Re: Nweb: a tiny, safe web server (static pages only)
#62> if LINUX sleep for one second to ensure the data arrives at the browser can someone explain that please?
It's explained further down: After the last byte of the file is sent, the nweb web server web() function stops for one second. This is to enable the file contents to be sent down the socket. If it immediately closes the socket, some operating systems do not wait for the socket to finish sending the data but drops the connection very abruptly. This would mean that some of the file content would not get to the browser,…
Re: Nweb: a tiny, safe web server (static pages only)
#63Earlier quoted context omitted.
It's explained further down: After the last byte of the file is sent, the nweb web server web() function stops for one second. This is to enable the file contents to be sent down the socket. If it immediately closes the socket, some operating systems do not wait for the socket to finish sending the data but drops the connection very abruptly. This would mean that some of the file content would not get to the browser,…
This text has an error rate of about one factual error per sentence, as you'd expect from someone who capitalizes "Linux" as if it were an acronym.
Still it's good for building your confidence as a programmer, no?