Skip to content

Allow disabling engine.io from emitting CORS headers #331

@buunguyen

Description

@buunguyen

I've deployed a socket.io app behind Nginx, which is configured to emit CORS headers. The problem is socket.io also emits the same headers, which is disallowed by browsers due to non-duplication rule.

To fix this, I moved all CORS handling to the app. This works except when Nginx cannot reach the backend (e.g. server is restarted) and return responses without CORS headers, causing browsers to reject all requests, including the socket.io XHR polling requests. When this happens, the client app cannot see the error status and message returned by Nginx to display proper error messages to users.

It would be great if there's an option to prevent engine.io from emitting CORS headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions