卷曲:连接被拒绝

时间:2016-12-07 21:04:19

标签: linux ubuntu curl

运行curl时出现以下错误:

  

卷曲:(7)无法连接到127.0.0.1端口8080:连接   拒绝。

似乎很容易调试,但是,我没有找到解决方法。 文件etc/hosts中提到了地址127.0.0.1。

我在Ubuntu系统上使用curl版本7.47。

有人对此有所了解吗?

谢谢。

4 个答案:

答案 0 :(得分:4)

确保您已启动服务并在端口上监听。

"properties": {
    "privateIPAddress": {
      "type": "string",
      "description": "PrivateIPAddress of the network interface IP Configuration."
    },
    "privateIPAllocationMethod": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "Static",
            "Dynamic"
          ]
        },
        {
          "$ref": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
        }
      ],
      "description": "PrivateIP allocation method."
    },  

netstat -ln | grep 8080

答案 1 :(得分:0)

尝试使用curl -v http://localhost:8080/代替127.0.0.1

答案 2 :(得分:0)

在一个会话中监听端口,然后打开另一个会话用 l$ curl -v http://localhost:8080/ 测试它

它应该可以工作。这就是我的工作方式,虽然在我 终端

答案 3 :(得分:-3)

127.0.0.1限制对除开发计算机之外的端口8000上的每个接口的访问。将其更改为0.0.0.0:8000,这将允许从curl连接。

相关问题