MiraiForum

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

    Unsolved 不懂就问,为什么我的消息上报没反应?

    HTTP API和第三方SDK
    1
    1
    178
    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.
    • H
      HClO last edited by

      我的setting.yml文件如下

      cors: 
        - '*'
      host: 0.0.0.0
      port: 8080
      authKey: 'INITKEYlOwBjACm'
      enableVerify: false
      cacheSize: 4096
      enableWebsocket: false
      report:
        enable: true # 必须为true
        groupMessage:
          report: true  # 群消息上报
        friendMessage:
          report: true # 好友消息上报
        tempMessage:
          report: true # 临时会话上报
        eventMessage:
          report: true # 事件上报
        destinations:
        	- 'http://127.0.0.1:5000/report'
        extraHeaders: {}
      
      heartbeat: 
        enable: false
        delay: 1000
        period: 15000
        destinations: []
        extraBody: {}
      
        extraHeaders: {}
      adapterSettings:
        http:
          ## http server 监听的本地地址
          ## 一般为 localhost 即可, 如果多网卡等情况,自定设置
          host: localhost
      
          ## http server 监听的端口
          ## 与 websocket server 可以重复, 由于协议与路径不同, 不会产生冲突
          port: 8080
      
          ## 配置跨域, 默认允许来自所有域名
          cors: [*]
      
      

      接下来是用flask框架写的服务器端代码

      @app.route('/report',methods=["POST"])
      def get_tasks():
          if request.method=='POST':
              print(request.__dict__)
              return '1'
      

      flask运行时的提示

       * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
      

      上报地址应该没错?但不仅控制台没有打印信息,用fiddler抓包也找不到上报的包
      求解惑,万分感谢!

      1 Reply Last reply Reply Quote 0
      • Topic has been marked as a question  H HClO 
      • 1 / 1
      • First post
        Last post
      Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact