proxy may be a possible cause. I had a similar issue, it turns out proxy is turned on globally by a software. curl can be affected by proxy setup, and this is why it tries to access a port on a local machine even if it is not mentioned anywhere.