mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 06:05:06 +03:00
Expose socks5 errors in debug loglevel
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
parent
8177486dc8
commit
9fef230f6d
1 changed files with 6 additions and 2 deletions
|
@ -243,10 +243,14 @@ func (n *Node) SetupNetstack(socks *string, nameserver *string, expose *types.TC
|
|||
// Create SOCKS server
|
||||
if socks != nil && nameserver != nil && *socks != "" {
|
||||
resolver := types.NewNameResolver(s, *nameserver)
|
||||
server := socks5.NewServer(
|
||||
socksOptions := []socks5.Option{
|
||||
socks5.WithDial(s.DialContext),
|
||||
socks5.WithResolver(resolver),
|
||||
)
|
||||
}
|
||||
if n.logger.GetLevel("debug") {
|
||||
socksOptions = append(socksOptions, socks5.WithLogger(n.logger))
|
||||
}
|
||||
server := socks5.NewServer(socksOptions...)
|
||||
go server.ListenAndServe("tcp", *socks) // nolint:errcheck
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue