
Help: Using Wininet with an FTP Proxy that requires Authentication
Help!! I am trying to write an FTP client that will go through an FTP
Proxy that requires a username and a password. My FTP client is written
(in C) using the WININET.DLL. My FTP Proxy (it happens to be a Trusted
Information Systems brand) requires the following FTP commands:
USER proxyusername
PASS proxypassword
PASS destpassword
If I tell InternetOpen I have a proxy, then I do the InternetConnect,
Wininet sends only the second user/password sequence
work (but not how mine works). I tried setting the
INTERNET_OPTION_PROXY_USERNAME and INTERNET_OPTION_PROXY_PASSWORD on the
handle returned from InternetOpen, but that didn't seem to have any
affect. Has anyone tried that and gotten it to work with an FTP proxy?
If I tell InternetOpen I do not have a proxy, and then do the
InternetConnect to the proxy (not the destination), then I can log in to
the proxy with the proper proxyusername and proxypassword. However, I
can't figure out how to send a second USER/PASS sequence. There was
once an FtpCommand in the API, but that seems to have disappeared. Does
anyone know where it went? Does anyone know how to send raw commands to
an FTP server, given an InternetConnect handle? Is it possible to
obtain the WinSocket handle from the InternetConnect handle, and do a
WinSocket send()? Is there a WININET command to send a USER/PASS
sequence (to change the current user)?
I'll buy you a beer if you help me :-).