I have a working xmpp client on webapp using strophe.js, according to my usage scenario I have to quickly switch to different pages
The current approach is unsafe, since the jid and password are visible in the java script, I found work to ensure security in the strophe client, trying to make the connection time (with bosh) shorter, going through the book “XMPP Programming with JavaScript and jQuery” by jake moffitt i stumbled upon one solution in which both my problems above to implement the session.which mechanism says that we can use stanza binding (jid, sid, rid) to connect to an existing connection, so I need the SID and RID that I can get from the application server !!!
the book gave an example of automatic connection to the bosh server when a user logs into a web application, the author implemented it using the Django project in python. Since I use java as the server-side language, I tried to implement the same example using java smcak-4.0.3 and smack-bosh-4.0.3 but cannot connect to the bosh server (I use ejabberd as the xmpp server)
my code is below
BOSHConfiguration config = new BOSHConfiguration(false,"192.168.0.106",5280,"/http-bind/","192.168.0.106");
XMPPBOSHConnection xbc=new XMPPBOSHConnection(config);
xbc.connect();
xbc.login("admin", "admin");
System.out.println(xbc.getConnectionID());
stack trace
java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:352)
at org.jivesoftware.smack.SmackConfiguration.processConfigFile(SmackConfiguration.java:347)
at org.jivesoftware.smack.SmackConfiguration.<clinit>(SmackConfiguration.java:155)
at org.jivesoftware.smack.ConnectionConfiguration.<init>(ConnectionConfiguration.java:67)
When I tried to login to the bosh server, it fails every time, I'm not sure what is wrong here, can someone explain to me?
Another thing I found is to get the session identifier (SID) using "xbc.getConnectionID ()", but how do I find the request identifier?
Any help on the above problem would be appiciable !!!!
Thanks in advance!