Skip to content

Instantly share code, notes, and snippets.

@clarketm
Forked from CMCDragonkai/socat_server.sh
Created June 23, 2017 21:05
Show Gist options
  • Save clarketm/640390e2b9fa572ae44175580683d215 to your computer and use it in GitHub Desktop.
Save clarketm/640390e2b9fa572ae44175580683d215 to your computer and use it in GitHub Desktop.
Socat: Simple HTTP Server
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment