GithubHelp home page GithubHelp logo

iperity / node-strophe Goto Github PK

View Code? Open in Web Editor NEW
7.0 8.0 12.0 40 KB

[?] A Node.js compatible version of Strophe.js, borrowed from https://github.com/dhruvbird/node-xmpp-bosh.

JavaScript 100.00%

node-strophe's Introduction

node-Strophe

A Node.js compatible version of Strophe.js, borrowed from https://github.com/dhruvbird/node-xmpp-bosh. This is code mostly identical to Strophe.js release 1.0.2.

Please note: All releases from version v2.0.0 onwards have been modified to work with jsdom 6 for compatibility with Node.js 4. jsdom 6 is not compatible with Node.js 0.x. If you're working on Node.js 0.x, use the node-Strophe 1.0.1 release. Also, if you're using jsdom in your own application (for example to load jQuery), the way to use jsdom has been changed. See https://github.com/tmpvar/jsdom.

Installation

  npm install node-strophe 

Usage

	// Configuration
	var server = 'bosh.my-server.com';
	var jid = '[email protected]';
	var password = '';

	// Requirements
	var strophe = require("node-strophe").Strophe;
	var Strophe = strophe.Strophe;

	// Set-up the connection
	var BOSH_SERVICE = 'https://' + server + '/http-bind';
	var connection = new Strophe.Connection(BOSH_SERVICE);

	// Log XMPP
	connection.rawInput = connection.rawOutput = console.log;

	// Connect
	connection.connect(jid, password);

See http://strophe.im/strophejs/ for more information on how to use Strophe.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.