If your nc has no proper option then the workaround may be to detect communication from a client and kill the entire command line. If seconds is negative, wait forever (default). The explanation is:Īfter EOF on stdin, wait the specified number of seconds and then quit. Works fine (note I also need -p to specify port). In my Debian I have the -q capable version installed. Original, now inferior answer (it may still be useful for non-HTTP communication with nc)Īccording to this answer on Server Fault you need to use -c, -q or similar option, depending on nc implementation. In early December 2017 it works with Opera and Vivaldi it doesn't work with Firefox, Chrome or Safari, for which you may need another fix (see below). Īfter receiving this, your browser should continue with redirection, terminating the connection to nc on its own behalf. So your reply should be: printf 'HTTP/1.1 302 Moved\r\nLocation: \r\n\r\n' |.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |