Hacker News new | ask | show | jobs
by vbezhenar 4032 days ago
HTTP/2 does not allow communication from server to client. Server push is another matter, not really controlled by server or client. So you'll end up to polling server. This might be a bit more effective than HTTP/1 polling, but websockets will be better.
2 comments

Sure it does. HTTP/2 streams are bidirectional. The websocket flow can be perfectly emulated in HTTP/2: make a websockety request, get a 200 HTTP response, then both sides keep the stream open and send data through it.
How is it different from HTTP/1 with keep-alive connection?
basic server push can be implemented with Server Sent Events: https://developer.mozilla.org/en-US/docs/Server-sent_events/...