python 2.7 - sleekxmpp : ejabbered : not able to connect to sever -


i installed ejabbered , sleekxmpp. trying run sample program mentioned http://sleekxmpp.com/#here-s-your-first-sleekxmpp-bot . using ejabbered admin created sample user.

web admin->virtual hosts->selected test@test.com->users->added new user name password 

so modified code is:

if __name__ == '__main__':     # ideally use optparse or argparse jid,     # password, , log level.      logging.basicconfig(level=logging.debug,                         format='%(levelname)-8s %(message)s')      xmpp = echobot('test_user@test.com', 'password')     xmpp.connect()     xmpp.process(block=true) 

output:

debug    loaded plugin: rfc 6120: stream feature: starttls debug    loaded plugin: rfc 6120: stream feature: resource binding debug    loaded plugin: rfc 3920: stream feature: start session debug    loaded plugin: rfc 6121: stream feature: roster versioning debug    loaded plugin: rfc 6121: stream feature: subscription pre-approval debug    loaded plugin: rfc 6120: stream feature: sasl warning  dns: dnspython not found. can not use srv lookup. debug    dns: querying test@test.com aaaa records. debug    dns: error retreiving aaaa address info test@test.com. debug    dns: querying test@test.com records. debug    connecting xx.xx.xxx.xxx:5222 error    not connect xx.xx.xxx.xxx:5222. socket error #111: connection refused debug    no remaining dns records try. debug    waiting 2.27851082363 seconds before connecting. warning  dns: dnspython not found. can not use srv lookup. debug    dns: querying test@test.com aaaa records. debug    dns: error retreiving aaaa address info test@test.com. debug    dns: querying test@test.com records. debug    connecting xx.xx.xxx.xxx:5222 error    not connect xx.xx.xxx.xxx:5222. socket error #111: connection refused debug    waiting 1.85516992239 seconds before connecting. debug    no remaining dns records try. debug    waiting 3.72981095414 seconds before connecting. debug    starting handler thread debug    loading event runner debug    stopped event runner thread. -1 threads remain. debug    stopped send thread. -1 threads remain. debug    quitting scheduler thread debug    stopped scheduler thread. 0 threads remain. $ ^c 

please let me know how can rectify this?

===update====

i using wi-fi n/w when give ifconfig command below output:

$ ifconfig eth0      link encap:ethernet  hwaddr 30:f9:ed:cd:64:51             broadcast multicast  mtu:1500  metric:1           rx packets:0 errors:0 dropped:0 overruns:0 frame:0           tx packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            rx bytes:0 (0.0 b)  tx bytes:0 (0.0 b)  lo        link encap:local loopback             inet addr:127.0.0.1  mask:255.0.0.0           inet6 addr: ::1/128 scope:host           loopback running  mtu:16436  metric:1           rx packets:4043 errors:0 dropped:0 overruns:0 frame:0           tx packets:4043 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            rx bytes:606641 (606.6 kb)  tx bytes:606641 (606.6 kb)  wlan0     link encap:ethernet  hwaddr a4:17:31:de:e4:d9             inet addr:10.0.0.2  bcast:10.0.0.255  mask:255.255.255.0           inet6 addr: fe80::a617:31ff:fede:e4d9/64 scope:link           broadcast running multicast  mtu:1500  metric:1           rx packets:46103 errors:0 dropped:0 overruns:0 frame:0           tx packets:44757 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            rx bytes:48717711 (48.7 mb)  tx bytes:6499289 (6.4 mb) 

the 10.0.0.2 router address different xx.xx.xx.xxx displayed in program debug logs - ip configuration - if modify value?

== update ===

debug level logs shows me below info : [failed authentication test@test.com]:

further jabber client states error related certificate ignore option.

=info report==== 2013-08-26 18:12:49 === i(<0.37.0>:ejabberd_app:72) : ejabberd 2.1.10 started in node 'ejabberd@test.com'  =info report==== 2013-08-26 18:14:08 === i(<0.542.0>:ejabberd_listener:281) : (#port<0.1832>) accepted connection {{127,0,0,1},39872} -> {{127,0,1,1},5222}  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = "<?xml version='1.0'?><stream:stream xmlns=\"jabber:client\" to=\"test.com\" version=\"1.0\" xmlns:stream=\"http://etherx.jabber.org/streams\" xml:lang=\"en\" >"  =info report==== 2013-08-26 18:14:08 === d(<0.546.0>:ejabberd_c2s:1553) : send xml on stream = [60,63,120,109,108,32,                                                        118,101,114,115,105,                                                        111,110,61,39,49,46,48,                                                        39,63,62,60,115,116,                                                        114,101,97,109,58,115,                                                        116,114,101,97,109,32,                                                        120,109,108,110,115,61,                                                        39,106,97,98,98,101,                                                        114,58,99,108,105,101,                                                        110,116,39,32,120,109,                                                        108,110,115,58,115,116,                                                        114,101,97,109,61,39,                                                        104,116,116,112,58,47,                                                        47,101,116,104,101,114,                                                        120,46,106,97,98,98,                                                        101,114,46,111,114,103,                                                        47,115,116,114,101,97,                                                        109,115,39,32,105,100,                                                        61,39,"4262884447",39,                                                        32,102,114,111,109,61,                                                        39,                                                        "test.com",                                                        39,                                                        [" version='","1.0",                                                         "'"],                                                        [" xml:lang='","en",                                                         "'"],                                                        62]  =info report==== 2013-08-26 18:14:08 === d(<0.546.0>:ejabberd_c2s:1553) : send xml on stream = <<"<stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>scram-sha-1</mechanism><mechanism>digest-md5</mechanism><mechanism>plain</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='tq2jfyrosa70h2g1bpgjzuxb2su='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>">>  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>"  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,0,1377521048483549}, size=51 m=25.5, i=4.907   =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = []  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,983.8342528646939,                                     1377521048509468}, size=0 m=0.0, i=-19.024   =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = []  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,491.91712643234695,                                     1377521048510450}, size=0 m=0.0, i=93.656   =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = []  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,245.95856321617347,                                     1377521048604127}, size=0 m=0.0, i=6.537   =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = "<?xml version='1.0'?><stream:stream xmlns=\"jabber:client\" to=\"test.com\" version=\"1.0\" xmlns:stream=\"http://etherx.jabber.org/streams\" xml:lang=\"en\" >"  =info report==== 2013-08-26 18:14:08 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,122.97928160808674,                                     1377521048610682}, size=161 m=85.7742263697187, i=1.123   =info report==== 2013-08-26 18:14:08 === d(<0.546.0>:ejabberd_c2s:1553) : send xml on stream = [60,63,120,109,108,32,                                                        118,101,114,115,105,                                                        111,110,61,39,49,46,48,                                                        39,63,62,60,115,116,                                                        114,101,97,109,58,115,                                                        116,114,101,97,109,32,                                                        120,109,108,110,115,61,                                                        39,106,97,98,98,101,                                                        114,58,99,108,105,101,                                                        110,116,39,32,120,109,                                                        108,110,115,58,115,116,                                                        114,101,97,109,61,39,                                                        104,116,116,112,58,47,                                                        47,101,116,104,101,114,                                                        120,46,106,97,98,98,                                                        101,114,46,111,114,103,                                                        47,115,116,114,101,97,                                                        109,115,39,32,105,100,                                                        61,39,"665429700",39,                                                        32,102,114,111,109,61,                                                        39,                                                        "test.com",                                                        39,                                                        [" version='","1.0",                                                         "'"],                                                        [" xml:lang='","en",                                                         "'"],                                                        62]  =info report==== 2013-08-26 18:14:08 === d(<0.546.0>:ejabberd_c2s:1553) : send xml on stream = <<"<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>scram-sha-1</mechanism><mechanism>digest-md5</mechanism><mechanism>plain</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='tq2jfyrosa70h2g1bpgjzuxb2su='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>">>  =info report==== 2013-08-26 18:14:23 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = "<auth xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" mechanism=\"scram-sha-1\">biwsbj1zyxr5ysxyptg2ywzmytqxnzzjmmmxmzc1ndg1n2nmngu1zdcwntazntbimdu2ywq4ntc4zmmxna==</auth>"  =info report==== 2013-08-26 18:14:23 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,0,1377521048612173}, size=162 m=81.0, i=15096.97   **=info report==== 2013-08-26 18:14:23 === i(<0.546.0>:ejabberd_c2s:649) : ({socket_state,tls,{tlssock,#port<0.1832>,#port<0.1860>},<0.545.0>}) failed authentication test@test.com**  =info report==== 2013-08-26 18:14:23 === d(<0.546.0>:ejabberd_c2s:1553) : send xml on stream = <<"<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>">>  =info report==== 2013-08-26 18:14:23 === d(<0.545.0>:ejabberd_receiver:320) : received xml on stream = "<abort xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\" />"  =info report==== 2013-08-26 18:14:23 === d(<0.545.0>:shaper:61) : state: {maxrate,1000,5.365311472890604,                                     1377521063709153}, size=50 m=25.067246793407225, i=1.775  ^c 


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -