Skip to content

Instantly share code, notes, and snippets.

@sethgrid
Last active August 29, 2015 13:56
Show Gist options
  • Save sethgrid/8814431 to your computer and use it in GitHub Desktop.
Save sethgrid/8814431 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
reader := bufio.NewReader(r.Body)
data := make([]byte, 225)
length, err := reader.Read(data)
if err != nil {
fmt.Println(err)
}
fmt.Printf("goecho: %s (%d)\n", data, length)
})
fmt.Println("Starting Go Echo Server on port 9000")
http.ListenAndServe(":9000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment