|Subject:||Re: Indy 10 TIdHTTP and Port number|
|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Tue, 21 Dec 2004|
<jeff.east…@somewhere.com> wrote in message
> I am a little confused about the use of the TIdHTTP component
> and custom port numbers. There is no property to set if I have a
> web server running on a custom port.
You are supposed to specify the Port number in the URL itself, ie:
> Since I can't set the property in any way, I call Connect with the
> port number as a parameter.
Connect() does not have a Port parameter.
> I check the TIdHTTP object, and the Port is set to 600. Then I
> call Get to get a test page from the server, and when I do, I get a
> "Connection Refused" error.
Get() (and Post()) extracts the port number from the specified URL,
defaulting to 80 if not present, and then (re-)connects accordingly. Since
your web server is not running on port 80, TIdHTTP cannot connect to it.
> I again check the TIdHTTP object, and the Port has been
> switched back to 80 on me.
As well it should.
> And why isn't there simply a Port property to set like every other
> TCP client component?
There is such a property. Get() and Post() assign it dynamically based on
the specified URL, because the HTTP protocol requires the port number to be
specified in the URL in the first place.
Indy 10 TIdHTTP and Port number posted by jeff.east…@somewhere.com on Tue, 21 Dec 2004