Skip to content

Support Dynamic SSE Endpoints Like /:uid/sse #118

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

Open
weibaohui opened this issue Apr 7, 2025 · 4 comments
Open

Support Dynamic SSE Endpoints Like /:uid/sse #118

weibaohui opened this issue Apr 7, 2025 · 4 comments

Comments

@weibaohui
Copy link

By default, the SSE (Server-Sent Events) endpoint is /sse. But I want to use different endpoints like /xxxxx/sse or /yyyyy/sse, similar to how Gin handles routes like /:uid/sse.

I’d like to use server.WithSSEContextFunc(ctxFn) and pass in a custom function that can extract the xxxxx or yyyyy part from the http.Request. Based on that value, I will inject different information into the context (ctx) for further logic.

Can you help me do this?

@anhao
Copy link

anhao commented Apr 8, 2025

+1

@anhao
Copy link

anhao commented Apr 8, 2025

#121

@jkwang-a
Copy link

jkwang-a commented Apr 9, 2025

#126 help

@liut
Copy link

liut commented Apr 12, 2025

see also #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants