Skip to content

Instantly share code, notes, and snippets.

@sescobb27
Forked from groob/http2example.go
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sescobb27/e47dfffe96a6e9462515 to your computer and use it in GitHub Desktop.
Save sescobb27/e47dfffe96a6e9462515 to your computer and use it in GitHub Desktop.
package main
import (
"log"
"net/http"
"github.com/bradfitz/http2"
)
func main() {
var srv http.Server
srv.Addr = ":10443"
http2.ConfigureServer(&srv, &http2.Server{})
http.Handle("/", http.FileServer(http.Dir(".")))
log.Printf("About to listen on 10443. Go to https://127.0.0.1:10443/")
log.Fatal(srv.ListenAndServeTLS(
"localhost.crt", "localhost.key"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment