Unix/Linux Go Back    

Netcat ( nc -l ) as webserver

Emergency UNIX and Linux Support

Kindly Note - This is a Single User Post by Forum Member chakrapani Regarding:
Netcat ( nc -l ) as webserver.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 12-15-2016   -   Original Discussion by chakrapani
chakrapani's Unix or Linux Image
chakrapani chakrapani is offline
Registered User
Join Date: Sep 2009
Last Activity: 10 January 2017, 8:11 AM EST
Location: America
Posts: 207
Thanks: 0
Thanked 8 Times in 7 Posts
I made a named pipe and seems very close to getting my solution of garbing HTTP headers, Also noticed my browser does not Always send all the header each time.
(Chrome Version 54.0.2840.99 even in incognito )

My workaround (not solution) have a named pipe to communicated with nc.

$ mkfifo  webout

and then have the while loop to feed netcat(nc)

while true; do { echo -e 'HTTP/1.0 200 OK\r\n'; cat webout;  } | nc -vl 8080 >webout; done

I am just playing around with named pipe, looking to find something in the lines of:

nc -l PORT <webin > 2&1>webout

and then loop out with tail kind of thing on webin and webout. Any experts on FIFO's please suggest.

Last edited by chakrapani; 12-15-2016 at 11:50 AM.. Reason: typo