I'm mixing Ratchet with Phalcon framework and I'm facing a problem with HTTP responses.
I have an HTTP server and in the ConnectionHandler I have the following code when I receive a new connection (onOpen):
$conn->send(echo $myPhalconApplication->handle($uri)->getContent());
Printing out
echo $myPhalconApplication->handle($uri)->getContent()
gives me only the rendered html view.
The problem is that I don't have (or I don't know how to have) any type of control over the HTTP header (i don't want the content-type to be plain/text, mozilla shows the page as it was raw text, not html). Setting the header type in Phalcon doesn't work, I suspect that is because the Ratchet HTTP is setting his own headers. When I inspect the responses in my browser it says that the protocol is HTTP/0.9 OK.
I'm wondering if someone can point me where do I have to look or what I have to change to be able to modify the headers sent from the server.
I hope I'll be able to get the header problem solved once I know where to look. I've tried myself but I don't see where Ratchet is setting the headers.
Maybe disabling Ratchet headers and being able to send a Phalcon response directly will work too (I will try it as soon as I can, but I'm not sure if it will work).
Thanks.