Skip to content

salomvary/strophejs-crossxhr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's this?

A Strophe plugin to enable cross-domain XHR without using Flash. The limitation is that both domains have to be under the same "superdomain", in addition both protocol and port must be the same. The plugin utilizes the document.domain hack.

Trying the example code

Suppose your XMPP BOSH service is at http://chat.example.com:5280/http-bind and want to use it from http://example.com:5280/test.html

Get the code:

git clone http://github.com/salomvary/strophejs-crossxhr.git
cd strophejs-crossxhr
git submodule init
git submodule update

Customize the code:

  • edit service, jid and password in test.html
  • serve test.html from example.com:5280
  • set your domain in newxhr.html
  • serve newhxr.html from chat.example.com:5280
  • open http://example.com:5280/test.html in your browser

Documentation

See JSDoc comments in strophe-crosshxr.js and the example code.

Compatibility

Tested with:

  • Chrome 11
  • Firefox 4
  • IE9-8-7

Should work in others though...

About

A limited cross-domain XHR solution for Strophe XMPP library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published