Skip to content

Instantly share code, notes, and snippets.

@baleyko
Forked from CMCDragonkai/socat_server.sh
Created March 8, 2018 10:44
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baleyko/003a089deb4f532552ef674e9ff4cea9 to your computer and use it in GitHub Desktop.
Save baleyko/003a089deb4f532552ef674e9ff4cea9 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