func runProxy(t *testing.T, backendUrl string, proxyUrl chan<- string, proxyDone chan<- struct{ … } func runServer(t *testing.T, backendUrl chan<- string, serverDone chan<- struct{ … } func TestConnectionCloseIsImmediateThroughAProxy(t *testing.T) { … } func TestConnectionPings(t *testing.T) { … } type fakeStream … func (*fakeStream) Read(p []byte) (int, error) { … } func (*fakeStream) Write(p []byte) (int, error) { … } func (*fakeStream) Close() error { … } func (*fakeStream) Reset() error { … } func (*fakeStream) Headers() http.Header { … } func (f *fakeStream) Identifier() uint32 { … } func TestConnectionRemoveStreams(t *testing.T) { … }