Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. <stream:stream to='192.168.1.225' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  2.  
  3. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="daydate" xml:lang="en" id="80mu0xgew1" version="1.0" >
  4.  
  5. <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. <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  8.  
  9. <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  10.  
  11. <stream:stream to='192.168.1.225' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
  12.  
  13. <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="daydate" xml:lang="en" id="80mu0xgew1" version="1.0" >
  14.  
  15. <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. <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
  18.  
  19. <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09ImRheWRhdGUiLG5vbmNlPSJ0anpIMkhxMGJnRC9hVVdmNHAvZTNGaWdFYVpod0pHRGdzdkkrYXBPIixxb3A9ImF1dGgiLGNoYXJzZXQ9dXRmLTgsYWxnb3JpdGhtPW1kNS1zZXNz</challenge>
  20.  
  21. <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9InNhZ2FyIixyZWFsbT0iZGF5ZGF0ZSIsbm9uY2U9InRqekgySHEwYmdEL2FVV2Y0cC9lM0ZpZ0VhWmh3SkdEZ3N2SSthcE8iLGNub25jZT0iZjdmZmY5YjBmZDEwZGQ4ZGMxYWVhMzg2MDM2OTJmMzNkNDdjNGFlZWNhMTcwNzYwYzlhNmZlZjQwZjAyMmZmMCIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC8xOTIuMTY4LjEuMjI1IixjaGFyc2V0PXV0Zi04LHJlc3BvbnNlPTJkYWMyMDMxMDA2NDIxM2E3ZDBlOTFkMDUzYzQ1NjYx</response>
  22.  
  23. <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>
  26.  
  27. </stream:stream>
  28.  
  29. void Start () {
  30.  
  31.  
  32. connection = new JUN.Connection();
  33.  
  34. connection.Server = "192.168.1.225";
  35. connection.Port = 5222;
  36. connection.Username = "username"; //Without @domainName
  37. connection.Password = "password";
  38.  
  39. connection.AutoRoster = true;
  40. connection.AutoAgents = false;
  41. connection.AutoPresence = true;
  42. connection.AutoResolveConnectServer = false;
  43.  
  44. connection.SocketConnectionType = SocketConnectionType.Direct;
  45.  
  46. connection.OnReadXml += new XmlHandler(OnReadXml);
  47. connection.OnWriteXml += new XmlHandler(OnWriteXml);
  48. connection.OnLogin += delegate (object sender) { queue.Enqueue(() => OnLogin(sender)); };
  49. connection.OnClose += delegate (object sender) { queue.Enqueue(() => OnClose(sender)); };
  50. connection.OnError += new ErrorHandler(OnError);
  51. connection.OnPresence += delegate (object sender, Presence pres) { queue.Enqueue(() => OnPresence(sender, pres)); };
  52. connection.OnMessage += delegate (object sender, Message msg) { queue.Enqueue(() => OnMessage(sender, msg)); };
  53. connection.OnAuthError += new XMPPElementHandler(OnAuthError);
  54. connection.OnSocketError += new ErrorHandler(OnSocketError);
  55. connection.OnStreamError += new XMPPElementHandler(OnStreamError);
  56.  
  57. connection.OnConnectionStateChanged += delegate (object sender, ConnectionState state) { queue.Enqueue(() => OnConnectionStateChanged(sender, state)); };
  58. connection.Open ();
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement