title: How can I set up a http2 server in Go 1.8 without third party libraries?
body: <p>I heard that http2 would be supported in the latest Go versions. How can I put up a http2 server without using <code>golang.org/x/net/http2</code>?</p>
  
  <p>In previous versions you could do something like this:</p>
  
  <pre><code>package main
  
  import (
      "log"
      "net/http"
      "os"
  
      "golang.org/x/net/http2"
  )
  
  func main() {
      cwd, err := os.Getwd()
      if err != nil {
          log.Fatal(err)
      }
  
      srv := &amp;http.Server{
          Addr:    ":443",
          Handler: http.FileServer(http.Dir(cwd)),
      }
      http2.ConfigureServer(srv, &amp;http2.Server{})
      log.Fatal(srv.ListenAndServeTLS("server.crt", "server.key"))
  }
  </code></pre>