Skip to content

CORS and SSE #39

@jschoch

Description

@jschoch

I did some research on the CORS issue again, here's the state of things.

CORS-RFC1918 prevents "more private" network connections without a preflight " Access-Control-Allow-Private-Network: true" header sent from the browser and acked from the esp32. There is no issue if you are serving the static html from your private network. Adding the header on the esp32 is fairly easy to do but....

EventSource API does not allow you to add headers and...

Chrome/Firefox don't issue the preflight request because they don't seem to see the rfc1918 address, but they do kill the connection because they see a rfc1918 address....

So, it appears I need to re-write the frontend to use a polyfill that allows for event source preflight headers to be sent via the fetch() api.

Before I do that I plan on taking the current experimental branch and getting them released which should allow for configurable SSE or Websockets for updates, as well as options for interrupt driven/timer driven control logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions