Search code examples
curltelnet

Connection refused with telnet, curl works


I have a problem with setting up an appliance right now, which has to connect to some websites.

I have noticed that using curl works on the websites I need, but using telnet on port 80/443 gives an connection refused.

We have tested it on another location and telnet + curl works as intended. So can anyone explain me the difference between curl and telnet? Thanks for your help! :)

example:

Location 1:

curl google.com:80 -> website moved...

telnet google.com 80 -> connection refused

Location 2:

curl google.com:80 -> website moved...

telnet google.com 80 -> Escape character ^


Solution

  • Apples and Oranges. curl uses the HTTP protocol, while telnet uses an entirely different and unrelated protocol (and TCP/IP port number). The two are not related to one another.