Code Monkey home page Code Monkey logo

Comments (6)

efectn avatar efectn commented on May 21, 2024

@michealroberts is your endpoint working if you remove

case <-c.Context().Done():
    fmt.Println("Client disconnected. Closing connection.")
    return

from fiber.

michealroberts avatar michealroberts commented on May 21, 2024

@efectn Yeh, so it still doesn't work when removing that unfortunately ๐Ÿ˜ž

I have a branch here: https://github.com/observerly/nox/pull/48 for a full reproduction that you should be able to access. In that code, I've added the basic example given in the gofiber/examples repo for SSE setup, line for line, and unfortunately it still doesn't work ...

Are you able to work with SSE on the latest versions of Fiber and fasthttp?

from fiber.

efectn avatar efectn commented on May 21, 2024

@efectn Yeh, so it still doesn't work when removing that unfortunately ๐Ÿ˜ž

I have a branch here: observerly/nox#48 for a full reproduction that you should be able to access. In that code, I've added the basic example given in the gofiber/examples repo for SSE setup, line for line, and unfortunately it still doesn't work ...

Are you able to work with SSE on the latest versions of Fiber and fasthttp?

This one works for me https://paste.laravel.io/8c6a1464-4f52-46c1-b362-ab49f5ad60cf

2024-02-09_18-40

from fiber.

michealroberts avatar michealroberts commented on May 21, 2024

@efectn Aye aye aye, ok. I feel like I have narrowed it down to be able to replicate it.

I have the ETag middleware installed from github.com/gofiber/fiber/v2/middleware/etag ... I guess this somehow causes issues in terms of headers ๐Ÿค”

What are your thoughts on this? I should be able to get a minimal reproduction.

from fiber.

efectn avatar efectn commented on May 21, 2024

@efectn Aye aye aye, ok. I feel like I have narrowed it down to be able to replicate it.

I have the ETag middleware installed from github.com/gofiber/fiber/v2/middleware/etag ... I guess this somehow causes issues in terms of headers ๐Ÿค”

What are your thoughts on this? I should be able to get a minimal reproduction.

Yes it seems. You can disable etag for specific path like:

app.Use(etag.New(etag.Config{
	Next: func(c *fiber.Ctx) bool {
		return c.Path() == "/sse"
	},
}))

from fiber.

michealroberts avatar michealroberts commented on May 21, 2024

@efectn I think I will disable ETags globally for now, I have quite a number of SSE routes.

I wonder if I should open up a separate minimal, reproducible, example of the SSE + ETag issue, and maybe start to work on a possible fix ...

from fiber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.