Main configuration import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.messaging.simp.config.ChannelRegistration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; 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.config.annotation.WebSocketTransportRegistration; /** * @author * WebSocket configuration class */ @Slf4j @Configuration @AllArgsConstructor @EnableWebSocketMessageBroker public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {<!– –> private final WebSocketInterceptor webSocketInterceptor; private final WebSocketHandshakeInterceptor webSocketHandshakeInterceptor; […]
Tag: sockjs
SockJS in Spring Boot
SockJS in Spring Boot In Spring Boot, SockJS is a compatibility solution for implementing WebSocket. This article will introduce the principle, usage and sample code of SockJS. What is SockJS SockJS is a communication protocol between the browser and the server, which can establish a two-way communication channel based on HTTP between the browser and […]
Solve the Vue dependency error reporting Cannot read property ‘headers’ of null in SockJSServer.js
Foreword When making new requirements and needing to change the project code of Vue, an error suddenly appears TypeError: Cannot read property ‘headers’ of null at Server.socket.on (***/node_modules/webpack-dev-server/lib/servers/SockJSServer.js:68:32) I don’t know why this problem suddenly appeared. It is normal to make changes in this vue project before, so let me talk about my solution Solution […]
WebSocket implementation based on SockJS+Stomp
Foreword I made a function before, receiving the data pushed by the background through the websocket long link, and then dynamically rendering it on the front end. I haven’t come here to output a document, now output it. Introduction to WebSocket WebSocket is a method to realize real-time communication in Web applications, which can establish […]
Under the element-ui framework, SockJS and stompjs are used to realize the PC scan code login jump page (1)
Business requirements – scan the WeChat QR code on the PC side, confirm the authorized login on the applet side, and complete the login function PC login interface Authorize the login page after scanning the WeChat code After authorized login, the applet login is successful After the authorized login, the PC login is successful and […]
Under the element-ui framework, SockJS and stompjs are used to realize the PC scan code login jump page (2)
The previous article introduced the PC scan code login to obtain unlimited small program codes through the WeChat interface, and this article introduces the rest Using SockJS and stompjs under the element-ui framework to realize PC scan code login jump page (1) 2. Scanned and pending confirmation In the 6th to 10th stages of the […]
[Solved] vue-cli solves IE browser chunk-vendors.js prompts sockjs-client error
IE browser chunk-vendors.js reported sockjs error Click on the error location /***/ “./node_modules/sockjs-client/dist/sockjs.js”: /*!************************************************ ****!*\ !*** ./node_modules/sockjs-client/dist/sockjs.js ***! \************************************************ ***/ /*!no static exports found */ /***/ (function(module, exports, __webpack_require__) { Correct solution Reduce the version of sockjs-client, its dependencies are described in package-lock.json, if this happens, your version may be higher than the version given […]
[Solved] Vue reports error sockjs-node/info?t= or error info?t=
Foreword: Organize the problem log. Problem status: Related information: Introduction to sockjs-node sockjs-node is a JavaScript library that provides a cross-browser JavaScript API that creates a low-latency, full-duplex communication channel between the browser and the web server. Server: sockjs-nodeClient: sockjs-client The reason for the problem: During development, if the network environment is changed (for example, […]