Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (16 sloc) 406 Bytes
package main
import (
"net/http"
"golang.org/x/net/http2"
)
func main() {
var srv http.Server
srv.Addr = ":8080"
//Enable http2
http2.ConfigureServer(&srv, nil)
http.HandleFunc("/", index_main)
srv.ListenAndServeTLS("certs/localhost.cert", "certs/localhost.key")
}
func index_main(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("<h1><center> Hello from Go! </h1></center>"))
}
You can’t perform that action at this time.