In order to solve this problem I have been trying to come up with different approaches.
I thought of using CON file for inter-process communication as follows:
REM The findstr is pretty much useless in this example!
set /P _MyVar=<CON & echo !_MyVar! | nc -w 1 -l -p 80 | findstr Host 1> CON
But no matter what I do I have always to type something into the console so that whole command is interpreted.
I believe this set /P _MyVar=<CON
is blocking the process until something is provided to CON, therefore, the observed behaviour.
Is there any way to avoid this blocking behaviour so that the response from the netcat is tailored based on the request?