MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    连接请求被拒 Error: connect ECONNREFUSED

    HTTP API和第三方SDK
    1
    3
    304
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fceek last edited by

      Mirai运行在服务器上,用MCL启动,安装了mirai-api-http。启动及登录无报错,并显示指定端口已监听(http和ws)。VPS供应商的安全组开放了指定端口的入站,未启用UFW,iptables对端口放行并且每次请求可以看到有5个packet进来,netstats也显示端口正在被监听。
      同一端口被redir到nodejs端口的时候GET请求可以获取到网站首页,然后立即修改成redir到监听端口则请求被拒。控制变量法看的话大概确实是http-api的问题?

      配置文件如下:

      adapters:
        - http
        - ws
      
      enableVerify: true
      verifyKey: {secret}
      
      debug: true
      
      singleMode: true
      
      cacheSize: 4096
      
      adapterSettings:
        http:
          host: localhost
          port: 8080
          cors: [*]
        ws:
          host: localhost
          port: 8080
          reservedSyncId: -1
      

      端口也尝试过14519 14518之类的,症状相同。

      感谢!

      1 Reply Last reply Reply Quote 0
      • F
        fceek last edited by

        Update:

        设置了从公网端口到localhost端口的转发,现在可以检测到端口开放,并且可以发送请求了。但是所有的请求都会返回

        {
            "code": 400,
            "msg": "无效参数"
        }
        
        1 Reply Last reply Reply Quote 0
        • F
          fceek last edited by

          Update:

          使用Postman测试发现手动配置请求是可以正常返回的,那么应该是Cocoaframework内部的问题,和http-api没关系了。
          (可以Close Issue吗

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact