fix dtls connection
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"github.com/go-gost/core/dialer"
|
||||
"github.com/go-gost/core/logger"
|
||||
md "github.com/go-gost/core/metadata"
|
||||
xdtls "github.com/go-gost/x/internal/util/dtls"
|
||||
"github.com/go-gost/x/registry"
|
||||
"github.com/pion/dtls/v2"
|
||||
)
|
||||
@ -65,5 +66,9 @@ func (d *dtlsDialer) Dial(ctx context.Context, addr string, opts ...dialer.DialO
|
||||
MTU: d.md.mtu,
|
||||
}
|
||||
|
||||
return dtls.ClientWithContext(ctx, conn, &config)
|
||||
c, err := dtls.ClientWithContext(ctx, conn, &config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return xdtls.Conn(c, d.md.bufferSize), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user