Skip to content

Instantly share code, notes, and snippets.

@kakilangit
Created April 17, 2013 08:09
Show Gist options
  • Select an option

  • Save kakilangit/5402589 to your computer and use it in GitHub Desktop.

Select an option

Save kakilangit/5402589 to your computer and use it in GitHub Desktop.
serve 1MB per request
package main
import "net/http"
func main() {
bytes := make([]byte, 1024*1024)
for i := 0; i < len(bytes); i++ {
bytes[i] = 100
}
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write(bytes)
})
http.ListenAndServe(":8000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment