$loop = React\EventLoop\Factory::create();
$pusher = new \Pusher;
$context = new React\ZMQ\Context($loop);
$pull = $context->getSocket(ZMQ::SOCKET_PULL);
$pull->bind('tcp://0.0.0.0:5555');
$pull->on('message', array($pusher, 'someFunction'));
//following code made possible by Ratchet
//URL: http://socketo.me/docs/push#tying_it_together
$webSock = new React\Socket\Server('0.0.0.0:8080', $loop);
$webServer = new Ratchet\Server\IoServer(
new Ratchet\Http\HttpServer(
new Ratchet\WebSocket\WsServer(
new Ratchet\Wamp\WampServer(
$pusher
)
)
),
$webSock
);
$loop->run();
I have the following code:
socket.php:
pusher.php:
Both work fine from the command line, and I can also actually send out and receive data.
But whenever I try to execute the
pusher.php
from the browser (something that has to work in the production version eventually) nothing happens.Does anyone know what may be causing this? All ports etc are opened up as far as I know.