Skip to content
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

Resolves #475 #477

Merged
merged 1 commit into from
May 29, 2022
Merged

Resolves #475 #477

merged 1 commit into from
May 29, 2022

Conversation

waggledans
Copy link
Contributor

@waggledans waggledans commented May 27, 2022

Resolves #475

Flush response body for server-side events to avoid events buffering by goproxy.
I validated that it works with sse.

$ curl -x localhost:8080 localhost:3000/events
retry: 2000
id: 1
event: data
data: {"id":1,"data":"287039","time":"8:15:06 PM","final":false}
id: 2
event: data
data: {"id":2,"data":"267182","time":"8:15:07 PM","final":false}
id: 3
event: data
data: {"id":3,"data":"657946","time":"8:15:07 PM","final":false}

@waggledans
Copy link
Contributor Author

I could add a test that starts a server and fetches events via the proxy but it would require updating dependencies in go.mod (and, ideally, setting go version to 1.17 to leverage modules graph pruning to avoid pulling go-sse to other packages that use goproxy). wdyt @elazarl ?

@elazarl elazarl merged commit 8ea89ba into elazarl:master May 29, 2022
@elazarl
Copy link
Owner

elazarl commented May 29, 2022

@waggledans sounds good, I'll be happy to approve the PR

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

Successfully merging this pull request may close these issues.

goproxy buffers SSE (content-type: text/event-stream)
2 participants