-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support for SSE Routes #1245
Comments
Badgerati
added a commit
that referenced
this issue
Mar 4, 2024
Badgerati
added a commit
that referenced
this issue
Mar 17, 2024
… base secret which is used for signing
Badgerati
added a commit
that referenced
this issue
Mar 19, 2024
Badgerati
added a commit
that referenced
this issue
Mar 22, 2024
Badgerati
added a commit
that referenced
this issue
Mar 23, 2024
Badgerati
added a commit
that referenced
this issue
Mar 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support in Routes should be allowed to enable SSE, and only on
GET
Routes.as an example, some
Set-PodeSseConnection
function could be called from anAdd-PodeRoute
scriptblock which would set appropriate theContent-Type = text/event-stream
header, as well asCache-Control = no-cache
;Connection = keep-alive
; andAccess-Control-Allow-Origin = *
(if needed). AClientId
would also be generated for the connection, and set back asX-Pode-ClientId
similar to websockets. This function would also ensure that the Request Headers contain anAccept = text/event-stream
header, and that theMethod = GET
, otherwise the call should fail.The above function could also check for a
Last-Event-Id
header on the Request. A new$WebEvent.Sse
property could be populated with such info.Pode would then internal keep the inbound connection open, mapped against the Event Type and ClientId. A new
Send-PodeSseMessage
could be used to send messages from server-to-client(s), with optional ID/Event messages as well. Similar to websockets, these messages will be sent asynchronously, in case there are a lot of clients to sent messages to.A
Close-PodeSseConnection
function could be used to close an open client connection, or all connections for an event type.Optional: an
Add-PodeSseRoute
wrapper function forAdd-PodeRoute
, which will automatically deal the simple SSE Route configurations - ie: justSet-PodeSseConnection
.Docs:
The text was updated successfully, but these errors were encountered: