|
|
@@ -101,8 +101,13 @@ func (a *Access) Run(cli *CLI, version string) error {
|
|
101
|
101
|
}
|
|
102
|
102
|
|
|
103
|
103
|
func (a *Access) getIP(ntw mtglib.Network, protocol string) net.IP {
|
|
|
104
|
+ dialer := ntw.NativeDialer()
|
|
104
|
105
|
client := ntw.MakeHTTPClient(func(ctx context.Context, network, address string) (essentials.Conn, error) {
|
|
105
|
|
- return ntw.DialContext(ctx, protocol, address) //nolint: wrapcheck
|
|
|
106
|
+ conn, err := dialer.DialContext(ctx, protocol, address)
|
|
|
107
|
+ if err != nil {
|
|
|
108
|
+ return nil, err
|
|
|
109
|
+ }
|
|
|
110
|
+ return essentials.WrapNetConn(conn), err
|
|
106
|
111
|
})
|
|
107
|
112
|
|
|
108
|
113
|
req, err := http.NewRequest(http.MethodGet, "https://ifconfig.co", nil) //nolint: noctx
|