Skip to content

Instantly share code, notes, and snippets.

@ktor
Last active March 21, 2020 13:26
Show Gist options
  • Select an option

  • Save ktor/9cae6dde3ec7ea9793ec343e710fe4bb to your computer and use it in GitHub Desktop.

Select an option

Save ktor/9cae6dde3ec7ea9793ec343e710fe4bb to your computer and use it in GitHub Desktop.
Lightweight web server oneliner test with 20s delay in response
#!/bin/sh
printf 'HTTP/1.1 200 OK\n\n%s' "<html>" | nc -l -i 20 -p 8888 localhost
@ktor

ktor commented Mar 21, 2020 •

Copy link
Copy Markdown
Author

server will wait on port 8888 and respond to a request with <html> body after 20s from a request and then finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment