In Terminal it seems like no difference between the two
echo -en 'first\r\nsecond'
and echo -en 'first\n\second'
but in the code without \r it doesn't work
echo -en 'GET /test HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc localhost 9292
works, but
echo -en 'GET /test HTTP/1.1\r\nHost: localhost\n\n' | nc localhost 9292
doesn't
anyone can explain why it is?