Skip to main content

一个简单的http服务

· One min read

code

package main

import (
"fmt"
"log"
"net/http"
)

func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "hello world")
})
log.Println("server is running at http://127.0.0.1:8888")
http.ListenAndServe(":8888", nil)
}

ipv6如何访问