derp: introduce Conn interface

This lets us test with something other than a net.Conn.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2020-03-12 11:05:03 -04:00
committed by David Crawshaw
parent 41ac4a79d6
commit 43aa8595dd
4 changed files with 31 additions and 18 deletions
+1 -1
View File
@@ -32,6 +32,6 @@ func Handler(s *derp.Server) http.Handler {
http.Error(w, "HTTP does not support general TCP support", 500)
return
}
s.Accept(netConn, conn)
s.Accept(netConn, conn, netConn.RemoteAddr().String())
})
}