连接被拒绝/无法连接到主机 [英] Connection refused / couldn't connect to host

查看:799
本文介绍了连接被拒绝/无法连接到主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个进程正在我的远程Ubuntu计算机上的特定端口上运行,并且正在通过HTTP公开该端口。当我尝试使用curl与客户端连接时,无法连接,但是如果我在本地远程计算机上进行相同的调用,则可以看到它已连接。因此,我很确定这是网络问题,但不确定是什么问题?

I have a process that is running on a specific port on my remote Ubuntu machine and I'm exposing that port via HTTP. When I tried to connect with my client using curl, I'm not able to connect, but if I do the same call on the remote machine locally, I can see that it connects. So I'm pretty sure that it is a network issue, but just not sure what it is?

即使在远程主机上尝试,如果我遇到相同的错误,给出机器的实际IP地址!

Even trying on the remote host, I get the same error if I give the actual IP address of the machine!

Joes-MacBook-Pro:~ joe$ curl --verbose --insecure --cert .docker/cert.pem --key .docker/key.pem https://my.ip.address:1234/images/json  
* About to connect() to my.ip.address port 1234 (#0)  
*   Trying my.ip.address... Connection refused  
* couldn't connect to host  
* Closing connection #0  
curl: (7) couldn't connect to host  
Joes-MacBook-Pro:~ joe$ 


推荐答案

如果卷曲版本大于7.33.0-3,请先检查卷曲版本。

Please check your curl version first if it's greater than 7.33.0-3

将卷曲降级到7.33.0-3。现在有一个已知的错误,已修复,应在下一版本中发布。我也对此有所了解。

Downgrade curl to 7.33.0-3. There is a known bug that is now fixed and should be released with the next version. I got bit by this too.

参考链接:
https://bbs.archlinux.org/viewtopic.php?id=175433
http://sourceforge.net/p/curl/bugs/1319/

这篇关于连接被拒绝/无法连接到主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆