I'm having problems with Server Submission (SSE) events in Safari 9 and Safari 10. An SSE connection opens, closes immediately, and then reconnects in an endless loop.
This is client side code:
var events = new EventSource("/stream/events")
These are the HTTP response headers:
> GET /stream/events HTTP/1.1
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache
< Connection: keep-alive
< Content-Type: text/event-stream
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Last-Modified: Tue, 19 Sep 2017 05:28:22 GMT
< Strict-Transport-Security: max-age=31536000
< X-Accel-Buffering: no
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-Xss-Protection: 1; mode=block
< Date: Tue, 19 Sep 2017 05:28:22 GMT
< Transfer-Encoding: chunked
Some additional notes:
- I tested in Chrome and Firefox and cannot repeat
- I tested in Safari without https and cannot repeat
- I tested in Safari with https and could repeat
- Https certificates are automatically generated using Lets Encrypt
- The backend server is written in Go and uses http / 2 by default.
, Safari https. , - SSE https, - , .
. http2 , . http2 , .
:
@@ -2,6 +2,6 @@
Addr: ":443",
TLSConfig: &tls.Config{
GetCertificate: manager.GetCertificate,
- NextProtos: []string{"h2", "http/1.1"},
+ NextProtos: []string{"http/1.1"},
},
}