http
package main
import (
"fmt"
"net/http"
"os"
)
func hello(w http.ResponseWriter, r *http.Request) {
hostName, _ := os.Hostname()
fmt.Fprintf(w, "hello i am %s", hostName)
}
func main() {
http.HandleFunc("/", hello)
err := http.ListenAndServe("0.0.0.0:9000", nil)
if err != nil {
fmt.Println("http listen failed")
}
}