You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
23
vendor/swoole/benchmark/http.go
vendored
Executable file
23
vendor/swoole/benchmark/http.go
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU() - 1)
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Last-Modified", "Thu, 18 Jun 2015 10:24:27 GMT")
|
||||
w.Header().Add("Accept-Ranges", "bytes")
|
||||
w.Header().Add("E-Tag", "55829c5b-17")
|
||||
w.Header().Add("Server", "golang-http-server")
|
||||
fmt.Fprint(w, "<h1>\nHello world!\n</h1>\n")
|
||||
})
|
||||
|
||||
log.Printf("Go http Server listen on :8080")
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
Reference in New Issue
Block a user