Skip to content

Commit

Permalink
Update proxy.go use things-go/go-socks5
Browse files Browse the repository at this point in the history
  • Loading branch information
tututu-patch authored Nov 6, 2024
1 parent 3ee5178 commit 84c16fe
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"strings"
"sync"

"github.com/armon/go-socks5"
"github.com/haxii/fastproxy/bufiopool"
"github.com/haxii/fastproxy/superproxy"
"github.com/projectdiscovery/dsl"
Expand All @@ -35,8 +34,8 @@ import (
"github.com/projectdiscovery/tinydns"
errorutil "github.com/projectdiscovery/utils/errors"
readerUtil "github.com/projectdiscovery/utils/reader"
sliceutil "github.com/projectdiscovery/utils/slice"
stringsutil "github.com/projectdiscovery/utils/strings"
"github.com/things-go/go-socks5"
"golang.org/x/net/proxy"
)

Expand Down Expand Up @@ -181,15 +180,15 @@ func NewProxy(options *Options) (*Proxy, error) {

var socks5proxy *socks5.Server
if options.ListenAddrSocks5 != "" {
socks5Config := &socks5.Config{
Dial: proxy.httpTunnelDialer,
}
if options.Verbosity <= types.VerbositySilent {
socks5Config.Logger = log.New(io.Discard, "", log.Ltime|log.Lshortfile)
}
socks5proxy, err = socks5.New(socks5Config)
if err != nil {
return nil, err
socks5proxy = socks5.NewServer(
socks5.WithLogger(socks5.NewLogger(log.New(io.Discard, "", log.Ltime|log.Lshortfile))),
socks5.WithDial(proxy.httpTunnelDialer),
)
} else {
socks5proxy = socks5.NewServer(
socks5.WithDial(proxy.httpTunnelDialer),
)
}
}

Expand Down

0 comments on commit 84c16fe

Please sign in to comment.