From the course: Building Real-Time Web Apps with Spring Boot and WebSockets
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
SockJS tips and tricks
From the course: Building Real-Time Web Apps with Spring Boot and WebSockets
SockJS tips and tricks
- [Instructor] So, we finished laying the groundwork for a pretty decent chat application, both client and server. On the client side, we are using the SockJS client library. So, now might be a good time to just go over a few tips and tricks. One, when you're using the sock JS library, you should know that you can only have one connection at a time established with a server on a single domain. This limitation is caused by an in browser limit of outgoing connections. A single SockJS session uses up the two outgoing connections that a browser typically allows. Remember because this is duplex communication, we need a connection for incoming as well as outgoing data. Secondly, remember that a WebSocket is just an HTTP connection that gets upgraded after that initial handshake between the client and the server. But rest assured there's no difference between using SockJS with encrypted HTTP or unencrypted HTTP. They both should work just fine. In fact, some developers have said you might…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.