-1

I want to access the FTP server via python. It is behind our company's proxy.

On company's network, I can access the ftp server using

from ftplib import FTP
ftp_host = "example.com"
ftp_user = "my_ftp_user"
ftp_password = "my_ftp_password"
ftp.dir()

Outside company's network, I need to use proxy. I have the following details:

ftp_host
ftp_user
ftp_password
proxy_host
proxy_user
proxy_password

I have tried:

ftp = FTP(host=ftp_host, user=ftp_user, passwd=ftp_password, source_address=None, timeout=10000)

But it doesn't work.

Can someone help me for the same?

piby180
  • 388
  • 1
  • 6
  • 18
  • There are many types of proxies. Which one is your company using? Can you connect with any standalone FTP client? If you can, show us its settings and/or log file. – Martin Prikryl Jul 12 '19 at 10:45

1 Answers1

0

I think you connect first using proxy to stay in the same network or line of connection and after that do the connection to ftp

Check this link of solution about how to connect to the proxy using python

Using an http proxy python