Skip to content

Spring Boot Integration #58

@karlbanke

Description

@karlbanke

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"})

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