From d0cfd88d94f698c8916099b06f58495ccb92a0f6 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 24 Oct 2019 20:14:54 +0200 Subject: Add support for the new dialer and error on obfs4client --- shapeshifter.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shapeshifter.go b/shapeshifter.go index f744808..5387a6d 100644 --- a/shapeshifter.go +++ b/shapeshifter.go @@ -10,6 +10,7 @@ import ( "github.com/OperatorFoundation/obfs4/common/ntor" "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4" + "golang.org/x/net/proxy" ) type ShapeShifter struct { @@ -77,9 +78,10 @@ func (ss ShapeShifter) clientAcceptLoop() error { func (ss ShapeShifter) clientHandler(conn net.Conn) { defer conn.Close() - transport := obfs4.NewObfs4Client(ss.Cert, ss.IatMode) - if transport == nil { - ss.sendError("Can not create an obfs4 client (cert: %s, iat-mode: %d)", ss.Cert, ss.IatMode) + dialer := proxy.Direct + transport, err := obfs4.NewObfs4Client(ss.Cert, ss.IatMode, dialer) + if err != nil { + ss.sendError("Can not create an obfs4 client (cert: %s, iat-mode: %d): %v", ss.Cert, ss.IatMode, err) return } remote, err := transport.Dial(ss.Target) -- cgit v1.2.3