Skip to content

Instantly share code, notes, and snippets.

@fmoo
fmoo / ftplib_simple_proxy.py
Created December 29, 2012 23:27 — forked from anonymous/ftplib_simple_proxy
An FTP client implementation that supports sending and receiving data via SOCKS proxy using PASV transfers
import ftplib
import socket
import socks # socksipy (https://github.com/mikedougherty/SocksiPy)
class FTP(ftplib.FTP):
def __init__(self, host='', user='', passwd='', acct='',
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
proxyconfig=None):
"""Like ftplib.FTP constructor, but with an added `proxyconfig` kwarg