GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Switch168/stanza.io: Modern XMPP in the browser, with a JSON API

This repository was archived by the owner on Aug 1, 2025. It is now read-only.
BranchesTags
Open more actions menu
 
 

Latest commit

 

History

641 Commits
641 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.jshintignore
.jshintignore
 
 
.jshintrc
.jshintrc
 
 
.travis.yml
.travis.yml
 
 
.validate.json
.validate.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
demo.html
demo.html
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

Stanza.io

Modern XMPP in the browser, with a JSON API.

Build Status Dependency Status devDependency Status

What is this?

Stanza.io is a library for using modern XMPP in the browser, and it does that by exposing everything as JSON. Unless you insist, you have no need to ever see or touch any XML when using stanza.io.

Important Protocol Changes

Starting with v4.0.0, stanza.io is using the protocol specified in RFC 7395 by default, which contains backwards incompatible changes.

Servers have started switching to using the RFC version of the WebSocket binding; notably, Prosody's WebSocket module for prosody-0.10. If your server has not yet been upgraded, you can set transports to ['old-websocket'] in the config:

var oldws = XMPP.createClient({
    ...
    transports: ['old-websocket']
});

Stanza Definitions Moved

As of v7.3.0, the XML/JSON mapping definitions have been split out into the jxt-xmpp module to allow their use outside of stanza.io itself.

Installing

$ npm install stanza.io

Building bundled/minified version (for AMD, etc)

First run npm install to get all of the dependencies, and then run make:

$ npm install
$ make

The bundled and minified files will be in the generated build directory.

Getting Started

  1. Find or install a server which supports XMPP over WebSocket (Prosody recommended).
  2. Run npm install in the node_modules/stanza.io directory.
  3. Run make to build build/stanzaio.bundle.js.
  4. Open demo.html in your browser.
  5. Enter your connection info, click connect.
  6. Use the JS console to play with the XMPP client (var client).

Echo Client Demo

var XMPP = require('stanza.io'); // if using browserify

var client = XMPP.createClient({
    jid: '[email protected]',
    password: 'hunter2',

    // If you have a .well-known/host-meta.json file for your
    // domain, the connection transport config can be skipped.

    transport: 'websocket',
    wsURL: 'wss://example.com:5281/xmpp-websocket'
    // (or `boshURL` if using 'bosh' as the transport)
});

client.on('session:started', function () {
    client.getRoster();
    client.sendPresence();
});

client.on('chat', function (msg) {
    client.sendMessage({
      to: msg.from,
      body: 'You sent: ' + msg.body
    });
});

client.connect();

Documentation

  • API Reference
  • Supported XEPs
  • Creating Plugins
  • Using PubSub

License

MIT

Created By

If you like this, follow @lancestout on twitter.

About

Modern XMPP in the browser, with a JSON API

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.