dougang7521 2018-03-21 13:29
浏览 83

无法使用AnyCable通过websocket连接Rails和Go

I am trying to configure Anycable in a Rails 5.2 application which needs to communicate with a GO server.

This is my anycable configuration in the Rails:

default: &default
rpc_host: "localhost:50051"
log_grpc: false
log_file: nil
debug: false # Shortcut to enable GRPC logging and debug level
log_level: info
redis_channel: "__anycable__" 
redis_sentinels: []


production:
  <<: *default
  redis_url: "redis://localhost:6379/1"

development:
  <<: *default
  redis_url: "redis://localhost:6379/2"

And the anycable server runs in localhost:3334 (Using default settings.) However when I try to connect to the same server from the GO application I am starting to get connection timeout errors from the Rails side. (Tried vice versa and got timeout on the GO side)

  • 写回答

1条回答 默认 最新

  • dongli4711 2018-03-23 19:39
    关注

    I have my next file:

    config/anycable.yml

    development:
      # gRPC server host
      rpc_host: "localhost:50051"
      # Redis URL (for broadcasting)
      redis_url: "redis://localhost:6379/2"
      # You can also turn on access logging
      access_logs_disabled: false
      debug: true
    

    and I run my servers:

    my file Procfile.dev is not neccessary

    web: bundle exec rails s -b 0.0.0.0 -p 3000
    rpc: bundle exec ./bin/anycable
    go: sleep 5 && ./cable/anycable-go-0.5.4 -addr 'host.lvh.me:8080' -disconnect_rate=1
    
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料