Link to home
Start Free TrialLog in
Avatar of Solifidian
Solifidian

asked on

Accessing FTP Site Through a Proxy Server

Hi

I've been having trouble accessing an FTP site through a Proxy server using Delphi 5 and the Netmasters TNMFTP component. I've been supplied with a proxy address and a proxy port, and am attempting to access the site through dial-up networking.

Whenever I try to connect to the ftp site (using the Connect method), I receive a timeout error :

"HTTP/1.0 408 Request Time-out"

I've also tried different firewall types, passive set at both true and false, but without success.

Using François Piette's Internet Component Suite (TFtpClient), I've tried using the username@ftp with the proxy as the ftp property, but that was also unsuccessful.

Does anyone possibly have a solution for me?

Thanks in advance,
Daniel.
Avatar of sunsetyang
sunsetyang

Please make sure that proxy server provides ftp service.
Avatar of Solifidian

ASKER

Unfortunately I've checked that. I've set up the proxy settings within Internet Explorer, and successfuly accessed the destination FTP from there. I'm not sure if the implementation is the same, but I'm hoping it's similar.
I've also tried 2 ISPs with Proxy servers, and both of them have given the same results.
Does the C:\Program Files\Borland\Delphi5\Demo\Fastnet\FTP demo work?
TNMFTP have properties:
Proxy
ProxyPort
UserID
Password

Did you try it?
listenning
ASKER CERTIFIED SOLUTION
Avatar of jeurk
jeurk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Listening
I've tried the Fastnet FTP demo, but that was unsuccessful as well. I'm going to try the Winshoes FTP component and see how I go. If it works, some points coming your way :)
Eventually managed to get the proxy working using the Winshoes TSimpleFTP component. Something else I found was that you need to set the ProxyName property using the following syntax :

ftp=proxy:port

eg

'ftp=proxy.isp.com:8080'

Thanks for all your help!

Daniel.
hello,

your are right, you have to add the port number in your adress.
To get the proxy parameters automaticaly you can use the param INTERNET_OPEN_TYPE_PRECONFIG for the dwAccessType parameter in the call of internet open. This retrieves the proxy parameter in the registry.

And this is how the winshoes components are doing it.

HINTERNET InternetOpen(
    IN LPCTSTR lpszAgent,
    IN DWORD dwAccessType,
    IN LPCTSTR lpszProxyName,
    IN LPCTSTR lpszProxyBypass,
    IN DWORD dwFlags
);

Look at http://msdn.microsoft.com/workshop/networking/wininet/reference/functions/InternetOpen.asp

this is the ms reference for all the internet related stuff.
http://msdn.microsoft.com/workshop/default.asp

Anyway, I'm pleased it is working.
CU