|
On Tue, 30 Nov 2004 17:51:47 -0600 (CST) Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> wrote: > > On Tue, 30 Nov 2004, Brad Stone wrote: > > > > Now, I know port 80 isn't needed in the HOST parm, but > does > > that also mean that for SSL you don't need to use 443, > or > > is that also default for SSL connections? Maybe it's > safer > > to just ALWAYS put the port in. :) > > > > To quote from RFC 2616 (and Ken's message): > > The Host request-header field specifies the Internet > host and port > number of the resource being requested, as obtained > from the original > URI given by the user or referring resource > (generally an HTTP URL, > as described in section 3.2.2). > > A "host" without any trailing port information > implies the default > port for the service requested (e.g., "80" for an > HTTP URL). > > The way I read this is that the port number should be > included in the HOST > header ONLY IF it was in the URI. > > And, if it's not given in the URI, it's not part of the > HOST header. > But, when programs need to know what port to > connect/receive on, they use > the DEFAULT FOR THE SERVICE. (The service being the > 'http:' or 'https:' > part of the URI.) > > It specifically does NOT say "always use 80 if not > given." Since it says > the default for the service, the default for https would > be 443, the > default for HTTP would be 80. If additional transports > are createde for > HTTP, they might have different services and use > different ports as well. > > So, that's the way that I'm going to do it in HTTPAPI. > (Actually, I > already did it that way on my test box.) > When GETURI get's a request, you can specify the URI and/or the port (confusing, but helps with using proxies). For example, let's say you use a proxy. The URI entered must contain the port number included in it (if it's not the default port for the service). Then, the port entered on the command is used to connect to the proxy. So, if you use a proxy, and need to use port 9999 on that proxy server, but are requesting google.com, you'd use: GETURI URI(google.com) PROXY(myproxy) PORT(9999) If you wanted port 8080 on google, you'd use: GETURI URI(google.com:8080) PROXY(myproxy) PORT(9999) If no proxy, then the port for the URI is specified on the PORT parm or in the URI. If the default of 80 is left on the port parm and the port on the URI is different, the URI port is used.. confusing, I know... LOL! But basically in the end whichever port is specified on the command is the one I would use in the Host header, even if it was the default port for the service. Just to be "safe"? Not sure if that's what you meant or not.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.