Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
angelsky #1
Member since Mar 2016 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Can't connect to remote Openfire Server but locally works fine
Hello, I'm able to connect to my local machine this way

  1. xmpp = new XmppClientConnection("MYLOCALMACHINE");
  2. xmpp.OnMessage += JabberOnMessage;
  3. xmpp.OnRosterItem += OnRosterItem;
  4. xmpp.OnIq += xmppOnIq;
  5. xmpp.OnWriteXml += (_, xml) => Invoke((Action)(() => txtReceiver.AppendText("Write -> " + xml + "\r\n\r\n")));
  6. xmpp.OnReadXml += (_, xml) => Invoke((Action)(() => txtReceiver.AppendText("Read -> " + xml + "\r\n\r\n")));
  7. xmpp.OnAuthError += OnAuthError;
  8. xmpp.OnPresence += OnPresence;
  9. xmpp.OnLogin += xmppCon_OnLogin;
  10. xmpp.OnSocketError += OnSocketError;
  11. xmpp.OnError += OnError;
  12. xmpp.Priority = 100;
  13. xmpp.Port = 5222;
  14. xmpp.KeepAlive = true;
  15. xmpp.Status = "Online";
  16. xmpp.RegisterAccount = false;
  17. xmpp.Open("a001", "a001zxcvb");

I installed Openfire on a remote machine, can't connect via Ip Address so
I configured an address with FreeDns.
On Android I can connect to REMOTE Openfire using the Ip so ports are ok.

when I try to conenct this way:

  1. xmpp = new XmppClientConnection("myexternalserver.mooo.com");
  2. xmpp.OnMessage += JabberOnMessage;
  3. xmpp.OnRosterItem += OnRosterItem;
  4. xmpp.OnIq += xmppOnIq;
  5. xmpp.OnWriteXml += (_, xml) => Invoke((Action)(() => txtReceiver.AppendText("Write -> " + xml + "\r\n\r\n")));
  6. xmpp.OnReadXml += (_, xml) => Invoke((Action)(() => txtReceiver.AppendText("Read -> " + xml + "\r\n\r\n")));
  7. xmpp.OnAuthError += OnAuthError;
  8. xmpp.OnPresence += OnPresence;
  9. xmpp.OnLogin += xmppCon_OnLogin;
  10. xmpp.OnSocketError += OnSocketError;
  11. xmpp.OnError += OnError;
  12. xmpp.Priority = 100;
  13. xmpp.Port = 5222;
  14. xmpp.KeepAlive = true;
  15. xmpp.Status = "Online";
  16. xmpp.RegisterAccount = false;
  17. xmpp.Open("a001", "a001zxcvb");

I get:

  1. Write -> <stream:stream to='myxmpp.mooo.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  2.  
  3. Read -> <stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" id="70zob8repk" xml:lang="en" from="id15325" >
  4.  
  5. Read -> <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
  6.  
  7. Write -> <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  8.  
  9. Read -> <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  10.  
  11. Write -> <stream:stream to='myxmpp.mooo.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  12.  
  13. Read -> <stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" id="70zob8repk" xml:lang="en" from="id15325" >
  14.  
  15. Read -> <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth" /><register xmlns="http://jabber.org/features/iq-register" /></stream:features>
  16.  
  17. Write -> <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
  18.  
  19. Read -> <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImlkMTUzMjUiLG5vbmNlPSJyR0Z2Ty9kdFNEVngzaWVSVGovSDZRN1FOcENxbFNZd1ROQ2swbjRmIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
  20.  
  21. Write -> <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImEwMDEiLHJlYWxtPSJpZDE1MzI1Iixub25jZT0ickdGdk8vZHRTRFZ4M2llUlRqL0g2UTdRTnBDcWxTWXdUTkNrMG40ZiIsY25vbmNlPSJjNzk2NzlhZmVlMTMxZWRlMDk4ZGVlZTJlYTM3OWI5MDY4N2FlNGQ1OTJmYzdkMDAxNzEzODc2OTZlYTdhNGJhIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL215eG1wcC5tb29vLmNvbSIsY2hhcnNldD11dGYtOCxyZXNwb25zZT0xNjk5Y2UyZDIxY2Y0ODFjZTM4YWQwZTZmY2I2NjJjYg==</response>
  22.  
  23. Read -> <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
  24.  
  25. <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>


What I don't understand is why I can't reach my server via IP address,
and when I use the the configured dns address I get this error when
conencting to it locally works (without IP but with machine name)?
I really would like to conenct using my NAT IP.
Thanks in advance.
This post was edited 2 times, last on 2016-03-15, 11:18 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Your server is configured from which you can see in the first 2 lies of your log:

  1. Write -> <stream:stream to='myxmpp.mooo.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  2. Read -> <stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" id="70zob8repk" xml:lang="en" from="id15325" >

You open the XMPP connection to the XMPP domain myxmpp.mooo.com
But your server replies and sais its hosting the domain id15325

If you success to connect with another client then this client is extremely fault tolerant. But you will run into problems very soon with other clients if you don't configure your XMPP domain on the server correctly.

Alex
Avatar
angelsky #3
Member since Mar 2016 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex for your fast answer, I solved changing my Openfire Domain as sugegsted here:
http://forum.ag-software.net/thread/1779-agsXMPP-authentic…

Thank you a lot!

Just one more question: why is not possible to use IP address of the server?
This post was edited on 2016-03-15, 12:55 by angelsky.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS