Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Response Type #218

Closed
ljfreelancer88 opened this issue Feb 27, 2021 · 0 comments
Closed

Server Response Type #218

ljfreelancer88 opened this issue Feb 27, 2021 · 0 comments

Comments

@ljfreelancer88
Copy link

ljfreelancer88 commented Feb 27, 2021

Is it possible to include server response type like event-stream or json? I have tried the code below but it's not working.

$server = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REP);
$server->bind("tcp://127.0.0.1:5555");

while ($message = $server->recv()) {
    header('Content-Type: text/event-stream');

    $server->send("data: $message");  
}
@ljfreelancer88 ljfreelancer88 changed the title Server Response Type for Server Sent Event Server Response Type Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant