Skip to content

Instantly share code, notes, and snippets.

@pahagon
Created March 15, 2011 20:38
Show Gist options
  • Save pahagon/871427 to your computer and use it in GitHub Desktop.
Save pahagon/871427 to your computer and use it in GitHub Desktop.
SOCAT
socat TCP4-LISTEN:9999,reuseaddr,fork,tcpwrap=script EXEC:"sh ./dummy_reply.sh"
socat TCP-LISTEN:80,bind=192.168.25.5,fork,reuseaddr,crlf SYSTEM:
socat openssl-listen:443,bind=192.168.25.5,fork,reuseaddr,verify=1,cert=/home/certs/sinkhole32.pem PIPE=echo "Media Center PC 6.0"
dummy_reply.sh:
#!/usr/bin/env bash
cat <<ENDL
HTTP/1.1 200 OK
Content-Length: 0
Connection: closed
Content-Type: text/html
ENDL
cat >/tmp/request.$$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment