Appendix B. Setting Up a BOSH Connection Manager

Web browsers do not yet speak XMPP. In order to use XMPP in web applications, a middleman is needed that turns the stateless HTTP requests into stateful and long-lived XMPP connections. The details surrounding this process are called Bi-directional streams Over Synchronous HTTP (BOSH), and a server that provides this service is called a connection manage

This chapter gives you the information you need to choose and install a BOSH connection manager for your XMPP applications. The applications in this book have all used a public BOSH connection manager provided by the author for testing purposes. If you plan to make your application widely available, you will probably want to set up your own.

Due to JavaScript's same origin policy (see the Same Origin Policy section of Chapter 3), direct communication with a connection manager is typically treated as a security violation. To circumvent this policy, the applications in this book have used a Flash library called flXHR to allow cross-domain requests. Alternatively, you can use a reverse proxy to make the connection manager appear to be part of your own web server.

The last section of this appendix shows you how to configure a reverse-proxied connection manager for the cases where using Flash is not possible or not desirable.


Connection managers come in two main flavors: built-in to an XMPP server or standalone managers. Each type has its own advantages and disadvantages ...

Get Professional XMPP Programming with JavaScript® and jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.