So, weirdly curl only connects to 'localhost' even if I am connecting to a different host.

curl -v https://registry.npmjs.org/
 *   Trying
 * Connected to registry.npmjs.org ( port 443 (#0)

Thus cannot curl to anything.

It's happening after I stop my VPN connection. I believe it will happen to all terminal apps which requests for external sources.

With VPN everything works fine. Maybe it's a security feature?

1 Answer 1


Check your shell environment. HTTPS_PROXY=localhost is a likely suspect, or ALL_PROXY. See the Environment section of man curl.

Another possibility is LD_LIBRARY_PATH, which may point to some of your VPN's libraries that intercept network calls in order to route them through the VPN.

  • hey thanks for the response. I had unset https_proxy and http_proxy. forgot to check all_proxy. And will try to check ld_library_path as well. Dec 14, 2020 at 9:21
  • Update: no http proxy, https proxy, all_proxy. ld_library_path is at oracle instantclient(not vpn related). Dec 14, 2020 at 9:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .