Connect to an FTP or SFTP server
Fixie proxides a SOCKSv5 proxy that can be used to connect to an FTP server through a static IP address. Conceptually, this is the same as establishing any other TCP connection using a Fixie SOCKSv5 proxy.
If your application is hosted on Vercel or Heroku, please also check out their respective documentation pages for more details
Configure your application
Update your application to use your Fixie proxy server. Making FTP requests via Socks Proxy is straightforward, but depending on the configuration of the FTP server, you may need to specify a specific Fixie IP address instead of using your load-balanced Socks Proxy URL. We recommend storing your credentials in Environment Variables under and FIXIE_SOCKS_HOST
name
Remember to keep sensitive configuration values, like credentials, out of source control.
FTP uses multiple TCP connections (a control connection and a transfer connection). If your FTP server supports "passive promiscuous" connections, connecting through the standard Socks Proxy URL works without issue. If, however, the server does not support "passive promiscuous" connections, both the control and transfer connection must go through the same IP. For this use case, you can proxy directly through a specific Socks Proxy IP instead of through a load-balanced Socks proxy group. You can find the IP address and credentials in the Fixie dashboard.
An example using cURL:
curl -v 'ftp://ftp2.census.gov/robots.txt' --socks5-hostname $FIXIE_SOCKS_HOST
We can also connect to an SFTP server using a Fixie SOCKS proxy. This is an example in Ruby, using the net-sftp
library:
proxy_uri = URI.parse("socks://#{FIXIE_SOCKS_HOST}")
socks_proxy = Net::SSH::Proxy::SOCKS5.new(
proxy_uri.host,
proxy_uri.port,
user: proxy_uri.user,
password: proxy_uri.password,
)
Net::SFTP.start(
...
proxy: socks_proxy,
) do |sftp|
sftp.download!("/path/to/file")
end
Having issues? Please reach out to our team here.