Closed peanball closed 9 months ago
EnableFullDuplex is currently failing on the ResponseController since ResponseWriter that is received in ServeHTTP is Negroni.ResponseWriter which does not provide EnableFullDuplex. There is an issue opened about Negroni being outdated.
Yes, I've opened that issue after attempting with this branch. The PR was to share progress with @geofffranks and can be closed now. I will do that latest next week when I'm back at work.
Closing this PR. It was an experiment with EnableFullDuplex
that didn't work and resulted in https://github.com/cloudfoundry/routing-release/issues/373.
@peanball I am looking into this right now. I think I would make PR to negroni to add this.
Negroni looks like a dead project through.
Before making a PR there we might consider a locally patched version, try if it gives us the gains that @geofffranks was hoping for and only then consider resurrecting this project.
That said, there might be other features we might like from newer Go versions now or later that would have to be added by us to Negroni instead of a framework's maintainers.
@peanball so I looked into this more and negroni provides an Unwrap
method to the ResponseWriter - https://github.com/urfave/negroni/commit/59d32aab419da1606c459c848c7586ef52b07a4b which will satisfy the latest ResponseController and eventually EnableFullDuplex
will be called on the underlying http.ResponseWriter.
Negroni actually has v2 and v3 versions, that are not visible on their releases page, but can be imported as github.com/urfave/negroni/v3
. The problem is that Unwrap
was not released on v3 yet. And looking at Issue the last comment from December 2023 stated that author is temporarily unavailable. So I would give it couple more months to see if he will be back and cut a new release. For now I pinned the negroni to latest v3.
Here is the proposed change for the Gorouter: https://github.com/cloudfoundry/gorouter/pull/395 Related change in routing-release: https://github.com/cloudfoundry/routing-release/pull/389
Negroni actually has v2 and v3 versions, that are not visible on their releases page, but can be imported as github.com/urfave/negroni/v3. The problem is that Unwrap was not released on v3 yet.
that's a great find, @mariash!
Admittedly I just checked the GH releases page, not the tags...
Experiments with
http.ResponseController.EnableFullDuplex()
.