Skip to content

Commit

Permalink
re
Browse files Browse the repository at this point in the history
  • Loading branch information
xjasonlyu committed Aug 29, 2024
1 parent 6a96a61 commit d3a4dea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ func SetDialer(d Dialer) {
_defaultDialer = d
}

// Dial uses default Dialer to dial TCP.
func Dial(metadata *M.Metadata) (net.Conn, error) {
ctx, cancel := context.WithTimeout(context.Background(), tcpConnectTimeout)
defer cancel()
return _defaultDialer.DialContext(ctx, metadata)
}

// DialContext uses default Dialer to dial TCP with context.
func DialContext(ctx context.Context, metadata *M.Metadata) (net.Conn, error) {
return _defaultDialer.DialContext(ctx, metadata)
Expand Down

0 comments on commit d3a4dea

Please sign in to comment.