Spring integrates tomcat's WebSocket detailed logic (diagram)

Mainly solve existing questions

  1. Why are there two ways for spring to integrate websocket? One is to use the @ServerEndpoint annotation, and the other is to use the @EnableWebSocket annotation. What are the differences and connections between the two? Can they coexist? What is the principle behind their implementation? What do their various configurations mean?
  2. How to authenticate when establishing a websocket connection between the server and the client? Any client cannot be allowed to connect to the websocket server, and authentication should not be done after establishing the websocket connection. Instead, authentication should be done during the handshake. How to achieve this?

insert image description here

Guess you like

Origin blog.csdn.net/qq_16992475/article/details/132747458