Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eshitachandwani committed Nov 29, 2024
1 parent 14b2763 commit ede36dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/testutils/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import (

const defaultTestTimeout = 10 * time.Second

type proxyServer struct {
// ProxyServer is a proxy server that is used for testing.
type ProxyServer struct {
lis net.Listener
in net.Conn
out net.Conn
Expand All @@ -39,7 +40,7 @@ type proxyServer struct {
}

// Stop functions stops and cleans up the proxy server.
func (p *proxyServer) Stop() {
func (p *ProxyServer) Stop() {
p.lis.Close()
if p.in != nil {
p.in.Close()
Expand All @@ -50,8 +51,8 @@ func (p *proxyServer) Stop() {
}

// NewProxyServer create and starts a proxy server.
func NewProxyServer(lis net.Listener, requestCheck func(*http.Request) error, errCh chan error, doneCh chan struct{}, backendAddr string, resolutionOnClient bool, proxyServerStarted func()) *proxyServer {
p := &proxyServer{
func NewProxyServer(lis net.Listener, requestCheck func(*http.Request) error, errCh chan error, doneCh chan struct{}, backendAddr string, resolutionOnClient bool, proxyServerStarted func()) *ProxyServer {
p := &ProxyServer{
lis: lis,
requestCheck: requestCheck,
}
Expand Down

0 comments on commit ede36dd

Please sign in to comment.