On 10/03/2017 02:41, radiatejava wrote:
Tomcat team, I have few questions on websocket:
Hi.

I am not member of the Tomcat team, but I will try to give you some answer or hints...

[...]

2. Is there any sample code for how to put in SSL (keystore and
truststore) websocket client ?
You should set that up at the JVM level, IMHO.

If you really want to do that specifically for the WS client, you can see

https://github.com/apache/tomcat/blob/trunk/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java

3. I want to create a websocket client within the Tomcat jvm. I know
there is an example TestWebSocketFrameClientSSL.java as part of Tomcat
project but wanted to know if that is the only way to create a
websocket. For example, if I have other websocket implementation
libraries in my tomcat server lib folder, how do I ensure I get the
implementation I want ? Which websocket implementation will I get when
I do : ContainerProvider.getWebSocketContainer();
I had a similar problem, as I use both Tyrus and Tomcat WS clients.

The implementation returned by

        ContainerProvider.getWebSocketContainer()

was undefined. Sometimes Tyrus, sometimes Tomcat.

So, I instantiate the specific type of each lib to be sure of what I get. For Tomcat WS client, this is :

    WebSocketContainer container = new WsWebSocketContainer();

Hope this helps,

Ludovic

|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to