Skip to content

Instantly share code, notes, and snippets.

@s-aska s-aska/capture.go
Created Sep 5, 2017

What would you like to do?
request capture
package main
import (
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%s %s HTTP/%d/%d\n", r.Method, r.URL.Path, r.ProtoMajor, r.ProtoMinor)
fmt.Fprint(w, "\n")
io.Copy(w, r.Body)
http.ListenAndServe(":8080", nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.