Gateway.php push between different servers, total error reported

the business server and the workerman server are not on the same machine. If you use Gateway.php to push messages, $registerAddress has been changed to public network ip, and $gateway- > lanIp in start_gateway.php has also been changed to public network ip. Then the business server can check online users, but keep reporting errors: stream_socket_client (): unable to connect to tcp://127.0.0.1:3300 (Connection refused) Gateway.php

Why is this 127.0.0.1? Under normal circumstances, it is the public network ip of workerman that should be monitored, but the listening here is 127.0.0.1. What else do you need to configure? May I ask the gods? (I have the same configuration on two machines inside the local area network. This is not 127.0.0.1, but the intranet ip, of the workerman server and can communicate normally.)

Jul.11,2021

found a way. Our fraudulent OPS full-text search lanIp found $lanIp = '127.0.0.1 listening in the vendor/workerman/gateway-worker/src/Gateway.php file. If you change this to the public network ip, listening ip, the problem is solved


1. For stand-alone deployment, the default setting is 127.0.0.1.
2. For distributed deployment, you need to set the cost of private network IP (not 127.0.0.1)

Menu