Skip to content

Instantly share code, notes, and snippets.

@sarimarton
Forked from CMCDragonkai/socat_server.sh
Created August 6, 2021 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarimarton/deea6e692d39e089a116c9733c369594 to your computer and use it in GitHub Desktop.
Save sarimarton/deea6e692d39e089a116c9733c369594 to your computer and use it in GitHub Desktop.
Socat Simple HTTP Server #cli #network
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