Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What port does httpclient use?

Tags:

What port does httpclient use?

80, 8080, ....?

like image 918
Anon Avatar asked Aug 03 '10 21:08

Anon


People also ask

What port is used for HTTP request?

The IP address is usually 127.0. 0.1. This is done by using a loopback address network. Port 80 is the common standard port for HTTP.

Is port 80 a client or server?

On a Web server or Hypertext Transfer Protocol daemon, port 80 is the port that the server "listens to" or expects to receive from a Web client, assuming that the default was taken when the server was configured or set up. A port can be specified in the range from 0-65536 on the NCSA server.


2 Answers

There are always two ports involved in a connection - one at the server, and another at the client.

The server-side port is specified (and is known to the client) via the HTTP URL (the default is 80 for HTTP connections and 443 for HTTPS) and is specified after the hostname using hostname:port notation.

On the client-side, things are a bit more interesting. Clients open a temporary or dynamic port that lasts only as long as the connection is made. Client-side ports are always opened on the dynamic range (49152 through 65535) reserved for them by IANA, which is usually enforced on the newer operating systems (I'm not sure if Windows XP follows the IANA directive to the letter, but Vista and Windows Server 2008 happen to).

like image 189
Vineet Reynolds Avatar answered Sep 21 '22 20:09

Vineet Reynolds


If you mean the destination port, the standard for the non-secure (HTTP) protocol is 80, whereas the standard HTTPS port is 443.

In terms of the outbound client port, that's largely irrelevant and will be chosen based on what ports are available, etc. (i.e.: There's no set outbound port.)

like image 30
John Parker Avatar answered Sep 21 '22 20:09

John Parker