Error when trying to connect to localhost on mac.

Asked 2 years ago, Updated 2 years ago, 307 views

When I try to access my Mac locally, I get the following error:

http://localhost
http://172.0.0.1

The following error occurs:

 curl:(7) Failed to connect to localhost port 80: Connection refused

By the way, I have deleted all the files and settings around docker.
Also, I checked with the following command and found that it was normal.

dig localhost+short
#172.0.0.1

I wonder if the configuration file has changed.I don't know what to fix, so please let me know.

Thank you for your cooperation.

macos

2022-09-30 21:50

1 Answers

If you want to access something over the network, including localhost, you must be running a program (so-called server) that responds on the destination side.

The "localhost port 80" in the error is trying to access via HTTP, so the web server must be up on the mac beforehand, and if the web server is not running, then "no response" is a normal result.


2022-09-30 21:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.