summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2019-10-24 20:14:54 +0200
committerRuben Pollan <meskio@sindominio.net>2019-10-24 20:14:54 +0200
commitd0cfd88d94f698c8916099b06f58495ccb92a0f6 (patch)
treefecaa5719e99eaf21a3d53b039118a20ad77ec7a
parent5ec01f9720e4deffe463671e4578cabb7ac16b04 (diff)
Add support for the new dialer and error on obfs4client
-rw-r--r--shapeshifter.go8
1 files 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)