Closed sumedh-plenarea closed 7 years ago
Hello, did you clean assets? As i understand problem is incorrect url when you trying to fire event from yii?
Appreciate you help. I missed to look in the cached assets which had old code pointing to localhost and when I cleared the cached from yii assets folder, it worked. Configuration required just one change to remove the binding of host from server.listen
method which I had already mentioned in the question so that it can accept requests from any IP address on Google Compute Engine.
Hi, I have configured this for Yii 1.1 and everything works fine on localhost. No issues at all. Now that I am trying to host my project on Google Compute Engine, I was having issues binding external IP to internal IP in order to start NodeJs server which was sending 404 on socket.io.js. I was able to fix it by removing the host from server.listen method so that it can bind to any IP address and socket.io js file is loaded to the client with it's public IP.
Client handshake to server is not working since the uinque url which is generated is still pointing to localhost on GCP when website is loaded. It should be server-ip instead of localhost. Please guide us resolve the issue.
My Node-Socket configuration is
'nodeSocket' => array( 'class' => 'application.extensions.yii-node-socket.lib.php.NodeSocket', 'host' => 'xxx.211.xxx.99', // default is 127.0.0.1, can be ip or domain name, without http 'allowedServerAddresses' => [ "127.0.0.1", "xxx.211.xxx.99", "::ffff:xxx.211.xxx.99" ], 'origin' => '*:*', 'port' => 3001 // default is 3001, should be integer )
Below is log when I try to fire events from Yii debug - served static content /socket.io.js debug - client authorized info - handshake authorized nvQHUiA9E1dBBKmHv69k debug - setting request GET /socket.io/1/websocket/nvQHUiA9E1dBBKmHv69k debug - set heartbeat interval for client nvQHUiA9E1dBBKmHv69k debug - client authorized for debug - websocket writing 1:: debug - client authorized for /server debug - websocket writing 1::/server info - transport end (undefined) debug - set close timeout for client nvQHUiA9E1dBBKmHv69k debug - cleared close timeout for client nvQHUiA9E1dBBKmHv69k debug - cleared heartbeat interval for client nvQHUiA9E1dBBKmHv69k debug - discarding transport
Let me know if you need any more information
Thanks....