Documentation ¶
Overview ¶
Package nettest provides a test server to test network listener handlers, similar to how net/http/httptest provides HTTP handler testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientTLS *tls.Config
ClientTLS is a client TLS config which trusts the localhost nettest server.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { Addr string // contains filtered or unexported fields }
func NewTLSServer ¶
NewTLSServer creates a TLS TCP server listening on 127.0.0.1:0 and runs handler with the listener. The listen address with the chosen port can be read from the server's Addr field. Clients should tls.Dial using ClientTLS as the TLS config.
Click to show internal directories.
Click to hide internal directories.