O'Reilly logo

Professional XMPP Programming with JavaScript® and jQuery by Jack Moffitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

CHOOSING A CONNECTION MANAGER

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required