Skip to content

Commit

Permalink
Implementing new proxy.Dialer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Dec 3, 2014
1 parent d5c9c8a commit 6f54a2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ func (client *Client) Dial(network, addr string) (net.Conn, error) {

// Close closes the cilent, in particular closing the underlying connection
// pool.
func (client *Client) Close() {
func (client *Client) Close() error {
if client.connPool != nil {
// We stop the connPool on a goroutine so as not to wait for Stop to finish
go client.connPool.Stop()
}
if client.masquerades != nil {
go client.masquerades.stop()
}
return nil
}

// HttpClientUsing creates a simple domain-fronted HTTP client using the
Expand Down
4 changes: 2 additions & 2 deletions domainfronted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/getlantern/keyman"
"github.com/getlantern/proxytest"
"github.com/getlantern/proxy"
"github.com/getlantern/testify/assert"
)

Expand Down Expand Up @@ -49,7 +49,7 @@ func TestUnit(t *testing.T) {
})
defer client.Close()

proxytest.Go(t, client.Dial)
proxy.Test(t, client)
}

// TestIntegration tests against existing domain-fronted servers running on
Expand Down

0 comments on commit 6f54a2b

Please sign in to comment.