File: httpd.sh

package info (click to toggle)
libreswan 5.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,644 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (7 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
# taken straight from the socat examples
port=$1 ; shift
ipv=4

socat -T 1 -d -${ipv} TCP-LISTEN:${port},reuseaddr,fork,crlf \
      SYSTEM:"echo -e \"\\\"HTTP/1.0 200 OK\\\nDocumentType: text/html\\\n\\\n<html>date: \$\(date\)<br>server:\$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT<br>client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\\\n<pre>\\\"\"; cat; echo -e \"\\\"\\\n</pre></html>\\\"\"" \
      > OUTPUT/$(hostname).httpd.${ipv}.${port}.log 2>&1 &