wget
is basically to retrieve HTTP contents from web servers. I want to know if wget is based on TCP or UDP? I did a search but some resources said it is TCP while others said UDP.
2 Answers
By default, wget
uses HTTP to retrieve files. Which means wget
uses TCP/80... unless you specify HTTPS, in which case it uses TCP/443.
-
1Or the URL explicitly includes the url, but yes, it's always TCP.– RickyCommented May 15, 2016 at 1:54
-
@rickyBeam Had to re-read that a few times. Did you mean the URL explicitly includes the port?– EddieCommented May 15, 2016 at 3:06
-
1It can... hxxp://www.example.com:8080/ or hxxps://www.example.com:8443/ Even hxxp://www:443/ and hxxps://www:80/ are legal URLs.– RickyCommented May 15, 2016 at 6:44
-
1@RickyBeam Yes, I understand that ;) I was just trying to understand your typo. ^_^– EddieCommented May 15, 2016 at 15:01
From the wget
manpage:
GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.
HTTP, HTTPS, and FTP are all TCP protocols (and respectively use default TCP ports 80, 443, and 20/21). Therefore the answer to your question is: wget uses TCP.
Any source that could have said that wget uses UDP is plain wrong. Since UDP is a connectionless, unreliable, not-acknowledged protocol, it is unfit for file transfer.