mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
@@ -456,9 +456,7 @@ func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
baseDialer := fshttp.NewDialer(ctx)
|
baseDialer := fshttp.NewDialer(ctx)
|
||||||
if f.opt.SocksProxy != "" {
|
if f.opt.SocksProxy != "" || f.proxyURL != nil {
|
||||||
conn, err = proxy.SOCKS5Dial(network, address, f.opt.SocksProxy, baseDialer)
|
|
||||||
} else if f.proxyURL != nil {
|
|
||||||
// We need to make the onward connection to f.opt.Host. However the FTP
|
// We need to make the onward connection to f.opt.Host. However the FTP
|
||||||
// library sets the host to the proxy IP after using EPSV or PASV so we need
|
// library sets the host to the proxy IP after using EPSV or PASV so we need
|
||||||
// to correct that here.
|
// to correct that here.
|
||||||
@@ -468,7 +466,11 @@ func (f *Fs) ftpConnection(ctx context.Context) (c *ftp.ServerConn, err error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
dialAddress := net.JoinHostPort(f.opt.Host, dialPort)
|
dialAddress := net.JoinHostPort(f.opt.Host, dialPort)
|
||||||
conn, err = proxy.HTTPConnectDial(network, dialAddress, f.proxyURL, baseDialer)
|
if f.opt.SocksProxy != "" {
|
||||||
|
conn, err = proxy.SOCKS5Dial(network, dialAddress, f.opt.SocksProxy, baseDialer)
|
||||||
|
} else {
|
||||||
|
conn, err = proxy.HTTPConnectDial(network, dialAddress, f.proxyURL, baseDialer)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
conn, err = baseDialer.Dial(network, address)
|
conn, err = baseDialer.Dial(network, address)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user