how to capture connection event in my webSocket server with Spring 4?

前端 未结 3 503
北海茫月
北海茫月 2021-01-05 19:55

I did a simple web socket communication with spring 4,STOMP and sock.js, following this https://github.com/rstoyanchev/spring-websocket-portfolio and this http://assets.spri

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 20:39

    This an be done with a connection handshake interceptor (HttpSessionHandshakeInterceptor), quoting the documentation:

    The easiest way to customize the initial HTTP WebSocket handshake request is through a HandshakeInterceptor, which exposes "before" and "after" the handshake methods.

提交回复
热议问题