From cef800119fa14503eaf1f25ed94a63a6789abc4b Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Tue, 4 Jun 2024 10:56:04 -0700 Subject: [PATCH] Bump 1.5.2 --- CHANGELOG.md | 2 ++ docs/sse.md | 17 +++++++++++++++++ version/version.go | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7542131..38d54bc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +## 1.5.2 (2024-06-04) + - Add `?raw=1` option for EventSource connections to receive only data messages (no protocol messages). ([@palkan][]) ## 1.5.1 (2024-04-16) diff --git a/docs/sse.md b/docs/sse.md index 91410915..a002ac9a 100644 --- a/docs/sse.md +++ b/docs/sse.md @@ -171,3 +171,20 @@ event: disconnect data: {"type":"disconnect","reason":"remote","reconnect":false} retry: 31536000000 ``` + +### Raw data streaming + +> @since v1.5.2 + +In some cases, you may not want to recieve protocol-level events (`welcome`, `confirm_subscription`) via an SSE stream (e.g., using with legacy clients). To consume only data messages, you can add an additional `?raw=1` option to the URL: + +```sh +$ curl -N "http://localhost:8080/events?channel=ChatChannel&raw=1" + +// no welcome or confirm_subscription or ping messages + +data: {"message":"hello"} +... +``` + +**NOTE:** This is only applicable to GET requests. diff --git a/version/version.go b/version/version.go index cf96d6e9..29b7b82e 100644 --- a/version/version.go +++ b/version/version.go @@ -8,7 +8,7 @@ var ( func init() { if version == "" { - version = "1.5.1" + version = "1.5.2" } if modifier != "" {