i want to use the java websocket API in a Spring Boot application. I created the following class as described here: https://www.baeldung.com/java-websockets
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
@ServerEndpoint(value = "/test")
public class FrontendEndpoint {
@OnOpen
public void onOpen(Session session) throws IOException {
session.getBasicRemote().sendText("Test");
}
@OnMessage
public void onMessage(Session session, String message) throws IOException {
}
@OnClose
public void onClose(Session session) throws IOException {
}
@OnError
public void onError(Session session, Throwable throwable) {
}
}
I try to connect to that websocket but nothing happens. I saw a lot of articles in the internet but nothing helped me. I dont know how to get it to work.
When i try to connect to the websocket nothing happend.
Spring Boot version: 2.0.3
Websocket-API version: 1.1
I also don't see an open port for the websocket.
Thanks
BR