Closed yuchenglin closed 8 years ago
If your separate php app is not on your Channel\Server, You should set ip to Emitter like this. Client side /public/index.php.
$emitter = new Emitter('your_channel_server_ip');
$emitter->emit('new message', 'TEST MESSAGE!!');
I only want to trigger the server event on different php page, and I test on local now. So it seems not that problem.
worker listen processes status
PHPSocketIO socketIO://0.0.0.0:2020 1 [OK]
ChannelServer frame://0.0.0.0:2206 1 [OK]
WebServer http://0.0.0.0:2022 1 [OK]
When I connect to localhost:2022
Your client should connect to PHPSocketIO port 2020 for your case, not 2022.
When I connect to localhost:2022
I mean that I used the browser to enter localhost:2022 in order to open index.php(separated php script). Do you mean I need to add codes to connect to PHPSocketIO before my client app (index.php)?
Do you mean I need to add codes to connect to PHPSocketIO before my client app (index.php)?
I mean you should connect to port 2020 by socket.io-client in your browser.
Thanks for your help! It works on the chatting room example(php socketio). If I learn some helpful explanations, I would like to add to the document.
You are welcome and thank you so much.
I came from this issue. I also want to send message from separate php app. When I connect to localhost:2022, I cannot get any log msg on server. Which part did I miss? It might be added into document. Thanks Server side:
Client side /public/index.php: