jWebSocket Forum

[Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Control is not going to the processToken method of the plugin  XML
Forum Index » Servers
Author Message
vaibhav

jWebSocket Forum User

Joined: 14/07/2015 16:47:47
Messages: 3
Offline

Hi,

We are working on implementing websocket through wss:\\.
We have made a custom plugin and register it in the token server. With ws:\\ everthying was working fine whenever the send token for the given plugin is fired at the client end the control goes to the public void processToken(PlugInResponse aResponse,WebSocketConnector aConnector, Token aToken) method of our plugin; but after wss:// implementation the control is going to the processLogoff(WebSocketConnector) method of our plugin.

We are using jWebSocketServer-Bundle-1.0.jar and jWebSocketTomcatEngine-1.0.jar on tomcat 7.0.30.

jWebSocket.xml config for tomcat
<engine>
<name>org.jwebsocket.tomcat.TomcatEngine</name>
<id>tomcat0</id>
<jar>jWebSocketTomcatEngine-1.0.jar</jar>
<!-- keystore file with in ${JWEBSOCKET_HOME}conf -->
<keystore>${JWEBSOCKET_HOME}conf/keystore.ks</keystore>
<!-- password to access keystore file -->
<password>xxxxxxx</password>
<!-- The jWebSocket TomcatEngine can either work in embedded mode
or in standard web app mode. In standard wep app mode the
jWebSocket Tomcat engine listens on same port like
Tomcats's http. The http protocol is upgraded to use WebSockets.
The http/websocket port can be configured via the Tomcat
configuration in the server.xml configuration file.
-->
<!-- set both port settings to "0" (null) if running Tomcat
Servlet Container for Web Apps and embed jWebSocket library.
This uses the settings from server.xml, wraps the existing
Tomcat WebSocket servlet and does NOT instantiate a separate
embedded engine at run time within jWebSocket.
-->
<port>0</port>
<sslport>0</sslport>
<!-- these domains are accepted by the engine listening
on the above mentioned port -->
<domains>
<domain>*</domain>
</domains>
<!-- default session timeout (minutes) -->
<timeout>1</timeout>
<!-- The default jWebSocket server web-app context. The context can be configured
through the files:
- ${JWEBSOCKET_HOME}/conf/TomcatEngine/conf/context.xml
- ${JWEBSOCKET_HOME}/conf/TomcatEngine/conf/web.xml
-->
<context>/jWebSocket</context>
<!--
maximum size of the data packet that the engine will read,
if the frame size is larger than this the connection will be closed.
-->
<maxframesize>1048840</maxframesize>
<!-- maximun number of connections allowed by this engine -->
<maxconnections>10000</maxconnections>
<!-- on max connections reached strategy -->
<!-- close, reject -->
<onmaxconnections>reject</onmaxconnections>
<settings>
<!-- directory that contains the public web folder path -->
<setting key="document_root">${JWEBSOCKET_HOME}web/</setting>
<!-- max threads property value for each tomcat connector -->
<setting key="max_threads">200</setting>
</settings>
</engine>

Client CodeUsing Chrome v43)
if( jws.browserSupportsWebSockets() ) {
var lConn = new jws.jWebSocketJSONClient();
var lURL = "ws://xxxxxxxxxxx:8443/assurance-streaming/jWebSocket";
lConn.open(lURL, {
OnOpen : function() {
$(document).ready(function() {
lConn.sendToken({ns: "our plugin", params......}, {OnSuccess: function(aResponse) {alert(aResponse);}});
});
},
OnWelcome : function(aEvent) {
console.log(aEvent);
},
OnMessage : function(aEvent, aToken) {
//console.log(aEvent);
// console.log(aToken.image);
},
OnClose : function() {
alert("Cannot establish connection with the server!");
}
});
}
Please help us out in this .
Any help is greatly appreciated .
poppy

jWebSocket Forum User

Joined: 10/09/2015 15:56:42
Messages: 1
Offline

hi vaibhav,
we are using wss with a custom plugin and it worsks for us.Not in Tomcat but standalone java server, but I guess the solution must be similar.

I've seen in your code:
var lURL = "ws://xxxxxxxxxxx:8443/assurance-streaming/jWebSocket";
First you have to put wss instead of ws

Then:
Is your ssl certificate a paid one or the one provided by jWebsocket or one generated by yourself?
In this last case Chrome is blocking your connection so first time write in your browser https://xxxxxxxxxxx:8443
and accept the exception.

If you continue with your problems tell me and we can compare your code with ours to try to find the problem.



paul092

jWebSocket Forum User

Joined: 07/10/2017 10:06:57
Messages: 4
Offline

Visit the given place and get the unscrambler scrabble word finder with which help you will play this game with much ease.
 
Forum Index » Servers
Go to:   
Powered by JForum 2.1.9 © JForum Team