title: Create an http response writer on top of net.Conn
body: <p>In the following code:</p>
  
  <pre><code>l, err := net.Listen("tcp", ":"+port)
  assert(err)
  c, err := l.Accept()
  assert(err)
  cert, err := tls.LoadX509KeyPair(TLS_CERT, TLS_PKEY)
  assert(err)
  TLSconfig := &amp;tls.Config{
      Certificates: []tls.Certificate{cert},
      ClientAuth:   tls.VerifyClientCertIfGiven,
      ServerName:   DOMAIN_NAME,
  }
  tlsConn := tls.Server(c, TLSconfig)
  tlsConn.Handshake()
  c = net.Conn(tlsConn)
  </code></pre>
  
  <p>I would like to create an http response writer, e.g.:</p>
  
  <pre><code>w := CreateResponseWriter(c)  //&lt;-- how to do this?
  w.Header().Set(...)
  if !Authorized(c.RemoteAddr()) {
      http.Error(w, "Unauthorized", http.StatusUnauthorized)
      return
  }
  data, _ := os.Open("/path/to/content")
  defer data.Close()
  io.Copy(w, data)
  </code></pre>
  
  <p>The purpose is that I am writing an http proxy in Golang, I will need to check if the remote connection is authorized or not, if not, I will show the login page.  Thanks.</p>