mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 16:01:55 +03:00
Make network as a separae interface
This commit is contained in:
+4
-6
@@ -73,12 +73,10 @@ func (c *cliCommandAccess) Run(cli *CLI) error {
|
||||
}
|
||||
|
||||
func (c *cliCommandAccess) getIP(protocol string) net.IP {
|
||||
client := &http.Client{
|
||||
Timeout: c.network.HTTP.Timeout,
|
||||
Transport: &http.Transport{
|
||||
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return c.network.DialContext(ctx, protocol, address)
|
||||
},
|
||||
client := c.network.MakeHTTPClient(0)
|
||||
client.Transport = &http.Transport{
|
||||
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return c.network.DialContext(ctx, protocol, address)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user