Skip to content

Commit

Permalink
rename Dial->DialTCP
Browse files Browse the repository at this point in the history
  • Loading branch information
aerth committed Feb 10, 2021
1 parent e773712 commit 4a47dce
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tgun.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,18 @@ func (c *Client) Join(s ...string) string {
return Join(s...)
}

// Dial (TCP) an address using c.Proxy if set
func (c *Client) Dial(addr string) (net.Conn, error) {
// DialTCP an address using c.Proxy if set
func (c *Client) DialTCP(addr string) (net.Conn, error) {
return c.Dial("tcp", addr)
}

// Dial an address using c.Proxy if set
func (c *Client) Dial(network string, addr string) (net.Conn, error) {
// Refresh http client, proxy
if err := c.refresh(); err != nil {
return nil, err
}
return c.dialer.Dial("tcp", addr)
return c.dialer.Dial(network, addr)
}

// Do returns an http response.
Expand Down

0 comments on commit 4a47dce

Please sign in to comment.