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
  • 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