I'm trying to configure a WebSocket over SSL with the "javax.websocket.server.ServerEndpoint" on a grizzly container. However i can't find any way to set the SSL property to my endpoint.
My endpoint code :
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
@ServerEndpoint(
Value="/ptiWs",
decoders = {ApiMessage.ApiCoder.class},
)
public class WebsocketEndpoint {
private static final Logger LOG = LogManager.getLogger(WebsocketEndpoint.class);
private final ApiVisitorImpl apiVisitor;
public WebsocketEndpoint(){
}
@OnOpen
public void onOpen(Session session){
LOG.info("New connection open : " + session.toString());
}
@OnMessage
public void message(Session session, ApiMessage message){
LOG.info("New message arrive " + message.toString());
}
}
Finally, I add my endpoint to my Grizzly instance with the following code :
Server ptiWebsocket = new Server("localhost", 8025, "/", null, WebsocketEndpoint.class);
ptiWebsocket.start();
I have already done this work for glassfish and it's pretty easy, but here i don't find any way to proceed.
And the dependency :
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-server</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-container-grizzly-server</artifactId>
<version>1.7</version>
</dependency>
Thanks