1 of 2
1
ejabberd upcoming HTTP-binding module
Posted: 17 April 2007 02:10 PM   [ Ignore ]
Newbie
Rank
Total Posts:  5
Joined  2007-04-12

Hi!

I have a problem for binding a client with my ejabberd server.
I put mod_http_bind.beam and ejabberd_http_bind.beam in my /ebin directory but i’m not able to see that the http-bind works fine.

I tried to connect on this url http://server:5280/http-bind/ and nothing happens except a Not Found message.

Is it possible that i have a bad version of this module ? Or are there others requirements to load this plugin?

(I also put that in my ejabberd.cfg file :
{mod_http_bind,  []}
{5280, ejabberd_http,[http_poll,http_bind, web_admin]}
)

Thanks for your answers

Nicolas

Profile
 
 
Posted: 26 May 2007 10:05 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11
oKiN - 17 April 2007 02:10 PM

Hi!

I have a problem for binding a client with my ejabberd server.
I put mod_http_bind.beam and ejabberd_http_bind.beam in my /ebin directory but i’m not able to see that the http-bind works fine.

I tried to connect on this url http://server:5280/http-bind/ and nothing happens except a Not Found message.

Is it possible that i have a bad version of this module ? Or are there others requirements to load this plugin?

(I also put that in my ejabberd.cfg file :
{mod_http_bind,  []}
{5280, ejabberd_http,[http_poll,http_bind, web_admin]}
)

Thanks for your answers

Nicolas

Please coment this somebody - I have the same problem…

But If I put in ejabberd.cfg

{listen,
[...
  
{5280, ejabberd_http, [http_poll, web_admin, {request_handlers, [{["http-bind"], mod_http_bind}]}]},
  ...
]}.

{modules,
[...
  
{mod_http_bind, []},
...
]}.

all requests of jhbtest.pl return 400 Bad Request

Profile
 
 
Posted: 30 May 2007 07:34 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11

I don’t understand logic.

{listen,
[...
  
{5280, ejabberd_http, [http_poll, web_admin, {request_handlers, [{["http-bind"], mod_http_bind}]}]},
  ...
]}.

here ejabberd_http using supervisor:start_child run mod_http_bind, and

{modules,
[...
  
{mod_http_bind, []},
...
]}.

try to run mod_http_bind too (using the same supervisor:start_child)

I last case we get error

{‘EXIT’, {start_child_error, Error}}

which handled gen_mod as

=ERROR REPORT==== 2007-05-30 00:19:13 ===
E(<0.35.0>:gen_mod:47) : {start_child_error,{already_started,<0.297.0>}}

Profile
 
 
Posted: 30 May 2007 08:46 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  151
Joined  2006-11-12

Hello,

The http_bind module is currently in development (SVN trunk). It works with ejabberd development version (SVN trunk), so for now it is only for people that would like to work with experimental code before the official ejabberd 2.0 release.
Use of this module will be documented in the official documentation guide when release.

In the meantime, if you want to evaluate this version you can simply add the following handler in the config file listen question:

{5280, ejabberd_http,    [{request_handlers, [{["http-bind"], mod_http_bind}]}]}

You also need to properly deploy a client supporting HTTP binding. If it is a web client, you will have to make sure that the client code and the HTTP binding handler are served by the same domain.

I hope this helps,

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 30 May 2007 12:55 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11

I found place where mod_http_bind crashed.

It is function ejabberd_http_bind:start/2

in my case:

start(“17c02ca4cf16a3f2d57737a6dd14af8678594314”, [])

failed on

supervisor:start_child(ejabberd_http_bind_sup, [Sid, Key])

with

=CRASH REPORT==== 30-May-2007::14:26:49 ===
  crasher:
  pid: <0.398.0>
  registered_name: []
  error_info: {{badmatch,{‘EXIT’,{noproc,
                          {gen_server,
                              call,
                              [ejabberd_http_bind_sup,
                              {start_child,
                                [“17c02ca4cf16a3f2d57737a6dd14af8678594314”,
                                  []]},
                              infinity]}}}},
            [{ejabberd_http_bind,process_request,1},
            {ejabberd_http,process_request,1},
            {ejabberd_http,process_header,2},
            {ejabberd_http,receive_headers,1},
            {proc_lib,init_p,5}]}
  initial_call: {ejabberd_http,receive_headers,
                      [{state,
                        gen_tcp,
                        #Port<0.362>,
                        undefined,
                        undefined,
                        undefined,
                        undefined,
                        undefined,
                        undefined,
                        “en”,
                        [{[“http-bind”],mod_http_bind},
                          {[“admin”],ejabberd_web_admin},
                          {[“http-poll”],ejabberd_http_poll}],
                        false,
                        []}]}
  ancestors: [ejabberd_http_sup,ejabberd_sup,<0.35.0>]
  messages: []
  links: [<0.235.0>,#Port<0.362>]
  dictionary: []
  trap_exit: false
  status: running
  heap_size: 1597
  stack_size: 21
  reductions: 2576
  neighbours:

in sasl.log


% Listened ports:
{listen, [
...
    
{5280, ejabberd_http, [http_poll, web_admin,
        
{request_handlers, [{["http-bind"], mod_http_bind}]}
        ]}
         ]}
.

and nothing with mod_http_bind in section

{modules,
[
...
]}

(see why below)


BTW, I get svn version of ejabberd-modules but
mod_http_bind not work anyhow properly because

ejabberd-modules\ejabberd-dev\trunk\include\

have old version of files

that why I replaced

ejabberd.hrl
ejabberd_ctl.hrl
ejabberd_http.hrl
jlib.hrl

from SVN version of ejabberd


any suggestions?

Profile
 
 
Posted: 30 May 2007 01:02 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  151
Joined  2006-11-12

I think you are using an http-polling client, using the http-bind module.
Can you verify that ?
Which client are you using ?

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 30 May 2007 01:10 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11
Mickaël Rémond - 30 May 2007 01:02 PM

I think you are using an http-polling client, using the http-bind module.
Can you verify that ?
Which client are you using ?

I suppose I use http-bind nevertheless…

for debug/test I use jhbtest.pl from
/ejabberd-modules/http_bind/trunk/util

which I modify for my server,

but I get error at first stage - get Sid

it is my body

<body
  content=‘text/xml; charset=utf-8’
  hold=‘0’
  rid=‘12345’
  to=‘myserver’
  wait=‘60’
  xml:lang=‘en’
  xmlns=‘http://jabber.org/protocol/httpbind’
/>

after that I wait for Sid

Profile
 
 
Posted: 30 May 2007 01:31 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  151
Joined  2006-11-12

Did you try with a “real” client ?
I never tried this jhbtest.pl tool, and I do not know if it is up to date or working.

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 30 May 2007 01:39 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11
Mickaël Rémond - 30 May 2007 01:31 PM

Did you try with a “real” client ?
I never tried this jhbtest.pl tool, and I do not know if it is up to date or working.

can you recommend to me “real” client?
I will test and notify you about result.

Profile
 
 
Posted: 30 May 2007 01:40 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  151
Joined  2006-11-12

Muckl or JWChat for example are working well with this module.
We will investigate your problem though.

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 30 May 2007 03:52 PM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  4
Joined  2007-05-30

By accident I fixed a few bugs related to ejabberd-modules/http-bind and tagged a new release ‘rel-1.2’.

@Victor: Please make sure you copied both files ‘mod_http_bind.beam’ and ‘ejabberd_http_bind.beam’ from ejabberd-modules/http-bind/*/ebin to your ejabberd-svn installation.

Profile
 
 
Posted: 30 May 2007 04:24 PM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11
zeank - 30 May 2007 03:52 PM

By accident I fixed a few bugs related to ejabberd-modules/http-bind and tagged a new release ‘rel-1.2’.

@Victor: Please make sure you copied both files ‘mod_http_bind.beam’ and ‘ejabberd_http_bind.beam’ from ejabberd-modules/http-bind/*/ebin to your ejabberd-svn installation.

C:\ejabberd-modules\http_bind\trunk>build.bat

C:\ejabberd-modules\http_bind\trunk>erl -pa ../../ejabberd-dev/trunk/ebin -pa ebin -make
Recompile: ../../ejabberd-dev/trunk/src/gen_mod
../../ejabberd-dev/trunk/src/gen_mod.erl:97: Warning: this clause cannot match because of different types/sizes
Recompile: src/ejabberd_http_bind
Recompile: src/mod_http_bind

what is it in bold font?

Profile
 
 
Posted: 01 June 2007 02:01 PM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  4
Joined  2007-05-30

@Victor: I don’t know but I don’t think it matters. mod_http_bind is working fine here despite this warning.

Profile
 
 
Posted: 01 June 2007 02:03 PM   [ Ignore ]   [ # 13 ]
Newbie
Rank
Total Posts:  27
Joined  2007-04-11
zeank - 01 June 2007 02:01 PM

@Victor: I don’t know but I don’t think it matters. mod_http_bind is working fine here despite this warning.

Yes, I works at last!

Thanks.

Profile
 
 
Posted: 20 June 2007 08:38 AM   [ Ignore ]   [ # 14 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  151
Joined  2006-11-12

Hey, good news !

 Signature 

Mickaël Rémond
ProcessOne

Profile
 
 
Posted: 27 June 2007 10:52 AM   [ Ignore ]   [ # 15 ]
Newbie
Rank
Total Posts:  2
Joined  2007-06-27

Hello.
I’m trying to use mod_http_bind (latest from svn) & ejabberd (from svn too).
It works with MUCkl + jsjac (also from svn)  and with simple auth enabled.

But mod_http_bind does not work with sasl and sasl anon auth.

[Срд 27 Июн 2007 12:29:37] (level 4) func: unknown
async recv
: <body xmlns='http://jabber.org/protocol/httpbind' sid='0f4a8e7abd4984059c1eda485c0956977f694ec5' wait='300' requests='2' inactivity='30' polling='2' authid='2650297528'/>
[Срд 27 Июн 2007 12:29:37] (level 4) func: JSJaCHBCHandleInitialResponse
Date
: Wed, 27 Jun 2007 09:30:51 GMT
Content
-Length: 170
Content
-Type: text/xml; charset=utf-8
[Срд 27 Июн 2007 12
:29:37] (level 4) func: JSJaCHBCHandleInitialResponse
<body xmlns='http://jabber.org/protocol/httpbind' sid='0f4a8e7abd4984059c1eda485c0956977f694ec5' wait='300' requests='2' inactivity='30' polling='2' authid='2650297528'/>
[Срд 27 Июн 2007 12:29:37] (level 2) func: JSJaCHBCHandleInitialResponse
got sid
: 0f4a8e7abd4984059c1eda485c0956977f694ec5
[Срд 27 Июн 2007 12
:29:37] (level 2) func: JSJaCHBCHandleInitialResponse
set hold to 1
[Срд 27 Июн 2007 12
:29:37] (level 4) func: JSJaCHBCGetStreamID
<body xmlns='http://jabber.org/protocol/httpbind' sid='0f4a8e7abd4984059c1eda485c0956977f694ec5' wait='300' requests='2' inactivity='30' polling='2' authid='2650297528'/>
[Срд 27 Июн 2007 12:29:37] (level 2) func: JSJaCHBCGetStreamID
got streamid
: 2650297528
[Срд 27 Июн 2007 12
:29:37] (level 2) func: JSJaCParseStreamFeatures
No support
for SASL detected

This is the output from jsjac debug.

I think that the main problem, that mod_http_bind doesn’t send headers like this:

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" authid="b592db3d" sid="b592db3d" secure="true" requests="2" inactivity="30" polling="5" wait="6"><stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features></body>


There is no stream features . So jsjac can’t detect presence of sasl.

Please comment this… I want to have muckl working with http-bind and saslanon auth. Help me=)

Profile
 
 
   
1 of 2
1
 
‹‹ Ejabberd      eunit tutorial by Dave Thomas ››