FTPAPI using HTTP Proxy

Discussions related to FTPAPI (An FTP client package for RPG programming.) http://www.scottklement.com/ftpapi/
basim
Posts: 9
Joined: Tue Oct 07, 2025 7:33 pm

Re: FTPAPI using HTTP Proxy

Post by basim »

Hi Scott,
I try to give you some example.
Proxy ip is 185.99.999.98
Final destination ip is 77.73.99.999 port 21
Using EPSV
ftptcp_getPeerAddr(peCtrlSock) return wwhost variable equal to 185.99.999.98 (proxy) port retrieve by message is 32148
pasvcmd return this connection return tcp_conn(wwHost: wwPort: wkTimeout) ----> here wwhost is the proxy
Under tcp_conn we have
if ftptcp_connect( wwSocket
: %trim(peHost) pehost is and proxhost here are the same so the connection failed
: pePort
: wkProxHost
: wkProxPort
: wkProxUser
: wkProxPass)

Using PASV
WWHOST and WWPORT are retrieved from the connection message in this case we have
WWHOST equal to 77.73.99.999 and WWPORT equal to 39486

Hope this can help

Thanks

Basilio
Post Reply