dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.99k stars 297 forks source link

[Question] HTTP3 support for mercure? #922

Closed DubbleClick closed 5 months ago

DubbleClick commented 5 months ago

Getting

This site can’t be reachedThe web page at https://my.valid.server/.well-known/mercure?topic=crm_overlay_20 might be temporarily down or it may have moved permanently to a new web address.
ERR_QUIC_PROTOCOL_ERROR

for any mercure endpoint. All other routes are correctly served over h3: image

Mostly just a question out of curiousity - if it isn't planned or supported, no big deal.

dunglas commented 5 months ago

HTTP/3 is supported by Mercure, through Caddy. You can check this thread to troubleshoot your installation: https://caddy.community/t/caddy-not-using-http3/19555

DubbleClick commented 5 months ago

Unfortunately, the thread is not really relevant. Mercure serves everything with h3, except for .well_known/ routes which mercure handles. When I force chrome to use h3 for those, I get the ERR_QUIC_PROTOCOL_ERROR.

DubbleClick commented 5 months ago

To bring it to the point, I'm asking whether mercures .well_known/ routes should work with h3. I know regular routes work.

dunglas commented 5 months ago

Yes this should work, as any other route.

DubbleClick commented 5 months ago

Hmm, I'll have to dig deeper then. Thank you for the clarification. I'll try specifying protocols for the mercure directive in the caddyfile and some other stuff. Will update when I figure it out in case others run into the same problem.

DubbleClick commented 5 months ago

Getting to it now. Turns out, the demo/ui endpoints do in fact work over h3, it's the https://my.valid.domain/.well-known/mercure?topic=any_topic routes that only work with h2 and not h3.

DubbleClick commented 5 months ago

I'm starting to believe that this is a Chrome issue. Using an experimental version of curl with --http3-only -k -I https://my.valid.domain/.well-known/mercure?topic=crm_overlay_20 connects just fine.

DubbleClick commented 5 months ago

So, I couldn't figure out why Chrome has a problem with it, but as long as I don't force h3 for the domain, it will happily load html/assets with h3 and fall back to h2 for the mercure streams. So there isn't necessarily a problem. Don't think this warrants a special notice or anything, since the problem doesn't appear to relate to mercure. Maybe it's the event-source content type that Chrome can't handle with h3.