GithubHelp home page GithubHelp logo

qinqd / mod-http-pre-bind Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thepug/mod-http-pre-bind

1.0 3.0 1.0 190 KB

An ejabberd module that pre binds an anonymous sasl session, returning the authenticated session.

Home Page: http://code.stanziq.com

License: Other

mod-http-pre-bind's Introduction

mod_http_pre_bind for ejabberd. 

When using anonymous users the authentication process through BOSH can
take a second or two.  These seconds can be saved by doing all of the
authentication and bosh session setup on one call. mod_http_pre_bind
does this and returns a jid,sid, and rid of a valid BOSH session.

It requires mod_http_bind.  Modifications are needed to mod_http_bind. The
start, http_put, handle_session_start, and prepare_response functions need
to be made public in the module code.  This prebind module simply calls those 
functions to initiate and handle a session.

To build run the build.sh script and install the resulting beam files
in your ejabberd ebin directory.

Install both in ejabberd.cfg.


{5288, ejabberd_http, [
                         http_bind, 
                         web_admin,
                         {request_handlers, 
                          [{["http-pre-bind"], 
                            mod_http_pre_bind}]}
                        ]}


%%
%% Modules enabled in all ejabberd virtual hosts.
%%
{modules,
 [
  {mod_http_bind,      []},
  {mod_http_pre_bind,      []},


Example post and response:

POST
<body to='example.com' rid='1234567' wait='60' hold='1' />



Response:
 <body xmlns='http://jabber.org/protocol/httpbind'   
       sid='892efca20cea238958f0603f89a6f8472ef790fe'   
       rid='1234568'>  
   <iq xmlns='jabber:client'  
       id='_bind_auth_2'  
       type='result'>  
     <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>  
       <jid>[email protected]/37436661951260831658614586</jid>  
     </bind>  
   </iq>  
</body>

mod-http-pre-bind's People

Contributors

thepug avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.