服务器跟公网IP分开时该怎么设置

daddycaccy

如果GatewayClient和GatewayWorker不是在同一台服务器上,则需要先将start_gateway.php中的lanIp改成当前服务器的内网ip(如果不在一个内网可改成公网ip)
华为云的服务器跟公网IP是分开的,如果设置成公网IP启动时就会报错Warning: stream_socket_server(): unable to connect to tcp://xxxxxxxxx:2903 (Cannot assign requested address)

1305 2 0
2个回答

daddycaccy

目前是能bing成功,但发消息就链接超时了

  • 暂无评论
walkor

这种情况无法使用gatewayClient。
http://doc2.workerman.net/push-in-other-project.html
可以考虑手册里的方案三

  • 今起 2021-11-08

    但是我需要使用ssl,可以用到方案三吗?

  • walkor 2021-11-10

    可以

  • 今起 2021-11-11

    @1:那用这种方法还可以分布式部署吗?

  • 今起 2021-11-12

    @1:按手册里面的操作报错。Fatal error: Uncaught Exception: Cannot assign requested address in /www/wwwroot/workerman-chat-hz/vendor/workerman/workerman/Worker.php:2257

  • 今起 2021-11-12

    @1: $internal_gateway = new Gateway("Text://0.0.0.0:7273");这里不写内网IP就可以

  • 今起 2021-11-12

    @8422:但是连接不上

  • 今起 2021-11-12

    端口7273已正常开放没问题的

年代过于久远,无法发表回答
🔝