Take the 2-minute tour ×

I'm implementing a real-time notification system using XMPP over BOSH and Strophe on the client-side, but I'm having some problems. When I log onto my website I establish a BOSH connection in back-end and save JID, SID and RID as cookies. When the page is reloaded I get the data from the cookies and attach to that session using Strophe's attach function. I get a callback status which says I've been attached.

The first problem I'm facing is that requests are being sent every second second or so. These are the request headers:

Request URL:http://localhost:7070/http-bind/
Request Method:POST
Status Code:200 OK

Request Headers
Accept: */*
Cookie:JSESSIONID=ibxwvm3ophp8; jiveforums.admin.logviewer="debug.size=0&info.size=0&warn.size=0&error.size=0"
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1 content-type:application/x-www-form-urlencoded

Form Data
< body rid:'3007' xmlns

Response Headers

I can't see any response content so I'm not sure what's causing it. The form data being sent looks like invalid and incomplete XML, is this what causes it or is that just how Chrome would format it in the debugger?

The other problem I'm facing is when I reload the page. I've bound an unload event to the window object in which I increase the RID by one and save it to the cookie. However, when the page is reloaded it says that I've attached to the BOSH session but then I get the following error message:

POST http://localhost:7070/http-bind/ 404 (Not Found) (localhost)

Uncaught Error: 16, ioError, An error occured preventing completion of the request. (flensed.js)

The next request will throw 404 (Invalid SID.) instead of 404 (Not Found) and repeats every 70+ seconds or so.

Has anyone else gotten this problem and know how to solve it? I'm frustrated!

Thanks in advance,

share|improve this question
did you get the solution ? –  Hunt Dec 4 '12 at 14:28
Sorry, I can't remember, Hunt. Probably not. We abandoned the implementation later. –  Pierre Wahlgren Dec 5 '12 at 20:05

1 Answer 1

Although you have abandoned the implementation, still the first problem you have mentioned is simply a continuous ping which the client server do in Openfire connections in order for the server to know that the client is up and running. The second error, not exactly sure but probably, arises as you are interrupting the communication in between and not terminating it gracefully. This may cause the strophe client to face some problems in binding to the port again. Also you face the problem repeatedly due to the ping mechanism mentioned above. You could've tried calling the connection.disconnect method after the window.onbeforeunload event was triggered. This would have ensured graceful termination and hence proper reconnection.

share|improve this answer

Your Answer


