refactor(jafar): remove unnecessary dep on netx (#497)

This commit is contained in:
Simone Basso
2021-09-09 18:01:20 +02:00
committed by GitHub
parent 1d79d70b43
commit b5826a0c44
4 changed files with 13 additions and 9 deletions
+6 -2
View File
@@ -12,9 +12,13 @@ import (
"sync"
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/engine/netx"
)
// Dialer establishes network connections
type Dialer interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
// CensoringProxy is a censoring TLS proxy
type CensoringProxy struct {
keywords []string
@@ -27,7 +31,7 @@ type CensoringProxy struct {
// the SNII record of a ClientHello. dnsNetwork and dnsAddress are
// settings to configure the upstream, non censored DNS.
func NewCensoringProxy(
keywords []string, uncensored netx.Dialer,
keywords []string, uncensored Dialer,
) *CensoringProxy {
return &CensoringProxy{
keywords: keywords,
@@ -174,8 +174,6 @@ func TestForwardWriteError(t *testing.T) {
type mockedConnReadOkay struct {
net.Conn
localIP net.IP
remoteIP net.IP
}
func (c *mockedConnReadOkay) Read(b []byte) (int, error) {