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

Spring Boot Integration #58

Closed
karlbanke opened this issue Mar 27, 2023 · 1 comment
Closed

Spring Boot Integration #58

karlbanke opened this issue Mar 27, 2023 · 1 comment

Comments

@karlbanke
Copy link

karlbanke commented Mar 27, 2023

The sample for the Spring Boot integration works fine.

However there is an issue with the WebSocket Handler class, in particular the way the http handler method is defined.

@RequestMapping(
                value = "/engine.io/",
                method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS},
                headers = "Connection!=Upgrade")
        public void httpHandler(HttpServletRequest request, HttpServletResponse response) throws IOException {
            mEngineIoServer.handleRequest(request, response);
        }

One must ensure that this Handler is only called when the client is not requesting a protocol upgrade. However the comparison in the headers evaluation is case sensitive. Some reverse proxies and loadbalancers like AWS Application Loadbalancer tend to correct the actual content of the Connection header and supply it as lowercase. In this case, in order to be able to run both

        @RequestMapping(
                value = "/engine.io/",
                method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS},
                headers = {"connection!=Upgrade", "connection!=upgrade"})
@trinopoty
Copy link
Collaborator

Hi,
The documentation has been updated with the provided information.

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

No branches or pull requests

2 participants