¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import io.undertow.server.DefaultByteBufferPool; |
| | | import io.undertow.websockets.jsr.WebSocketDeploymentInfo; |
| | | import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; |
| | | import org.springframework.boot.web.server.WebServerFactoryCustomizer; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Undertow èªå®ä¹é
ç½® |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Configuration |
| | | public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> { |
| | | |
| | | /** |
| | | * 设置 Undertow ç websocket ç¼å²æ± |
| | | */ |
| | | @Override |
| | | public void customize(UndertowServletWebServerFactory factory) { |
| | | // é»è®¤ä¸ç´æ¥åé
å
å 妿项ç®ä¸ä½¿ç¨äº websocket å»ºè®®ç´æ¥åé
|
| | | factory.addDeploymentInfoCustomizers(deploymentInfo -> { |
| | | WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); |
| | | webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 512)); |
| | | deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo); |
| | | }); |
| | | } |
| | | |
| | | } |