Skip to content

Instantly share code, notes, and snippets.

@saxbophone
Created August 4, 2015 16:34
Show Gist options
  • Select an option

  • Save saxbophone/7e266e074c28a3d31706 to your computer and use it in GitHub Desktop.

Select an option

Save saxbophone/7e266e074c28a3d31706 to your computer and use it in GitHub Desktop.
Fake Server - could-be one-liner in bash
fake_server() {
# function that takes port to listen on as first argument, file to read from as second
# perpetually listens on given port and outputs the contents of given file on connections
while true; do nc -l $1 < $2; done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment