1 package de.spring.stomp.interceptors;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.http.server.ServerHttpRequest;
6 import org.springframework.http.server.ServerHttpResponse;
7 import org.springframework.web.socket.WebSocketHandler;
8 import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;
10 public class CustomHttpHandshakeInterceptor extends HttpSessionHandshakeInterceptor {
11 private static final Logger LOGGER = LoggerFactory.getLogger(CustomHttpHandshakeInterceptor.class);
15 public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response,
16 WebSocketHandler wsHandler, Exception ex) {
17 super.afterHandshake(request, response, wsHandler, ex);
19 LOGGER.info("Request URI:" + request.getURI());
20 LOGGER.info("Request remote address:" + request.getRemoteAddress());
21 LOGGER.info("Request local address:" + request.getLocalAddress());
22 LOGGER.info("Request headers:" + request.getHeaders());
24 LOGGER.info("Response headers:" + response.getHeaders());