//package com.patzn.lims.config;
//
//import com.patzn.lims.stomp.WsHandshakeHandler;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.messaging.simp.config.MessageBrokerRegistry;
//import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
//import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
//import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
//import org.springframework.web.socket.server.standard.UndertowRequestUpgradeStrategy;
//
///**
// * <p>
// * STOMP 配置
// * https://github.com/spring-guides/gs-messaging-stomp-websocket
// * </p>
// * <p>
// *  location / {
// *     proxy_pass http://localhost:8080;
// *     proxy_set_header X-Real-IP $remote_addr;
// *     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
// *     proxy_set_header Host $http_host;
// *
// *     # For WebSocket upgrade header
// *     proxy_http_version 1.1;
// *     proxy_set_header Upgrade $http_upgrade;
// *     proxy_set_header Connection "upgrade";
// * }
// * </p>
// * @author hubin
// * @since 2018-01-02
// */
//@Configuration
//@EnableWebSocketMessageBroker
//public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
//
//    @Override
//    public void configureMessageBroker(MessageBrokerRegistry registry) {
//        registry.enableSimpleBroker("/topic", "/user");
//        // ptm = 帕特 Messenger
//        registry.setApplicationDestinationPrefixes("/ptm");
//        // 指定前缀用户主题发送消息
//        registry.setUserDestinationPrefix("/user");
//        // 可以 “.” 分割路径， 类级别的 @messageMapping . 方法级别的 @messageMapping
//       // registry.setPathMatcher(new AntPathMatcher("."));
//    }
//
//
//    @Override
//    public void registerStompEndpoints(StompEndpointRegistry registry) {
//        registry.addEndpoint("/ws")
//                 .setHandshakeHandler(new WsHandshakeHandler(new UndertowRequestUpgradeStrategy()))
//                .setAllowedOrigins("*").withSockJS()
//                .setClientLibraryUrl("https://cdn.bootcss.com/sockjs-client/1.3.0/sockjs.min.js");
//    }
//
//}
