Subject: Silverlight BOSH and Openfire with Matrix
Hello,
I am able to connect to an Openfire Server 3.6.4 using the sample application. I get the following exchange which appears fine to me at first glance. I am not sure why the server does not respond back after the password is sent (last SEND below). I am unable to get any further. There is nothing on the server side logs even though it can clearly communicate. Any help would be appreciated.
7:57:29 PM SEND:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="terry" version="1.0" >
7:57:29 PM RECV:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="terry" version="1.0" id="c852e5ec" >
7:57:29 PM RECV:
<stream:features xmlns:stream="http://etherx.jabber.org/streams">
<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>
7:57:29 PM SEND:
<auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
Here is the Connect() code:
_xmppClient.Username = login.Jid.User;
_xmppClient.Password = login.Password;
_xmppClient.XmppDomain = login.Jid.Server;
_xmppClient.Transport = Matrix.Net.Tranport.BOSH;
_xmppClient.Uri = new System.Uri("http://192.168.2.16/http-bind/");
_xmppClient.Port = 80;
if (!String.IsNullOrEmpty(login.Hostname))
_xmppClient.Hostname = login.Hostname;
_xmppClient.AutoPresence = false;
_xmppClient.Priority = login.Priority;
/*
* One restriction on using sockets in Silverlight 2 is that the port range that a network application
* is allowed to connect to must be within the range of 4502-4534.
* These are the only ports allowed for connection using sockets from Silverlight 2 applications.
* If a connection is to a port is not within this port range, the connection attempt will fail.
*
* If you connect over HTTP Proxy (see below) then this restriction does not apply to the Xmpp Port
* but it does to the ProxyPort.
*/
//_xmppClient.Port = 5222;
//_xmppClient.Port = 4503;
/*
* if you want to use Bosh then set the tarnsport to Bosh
* an the Uri to the correct Bosh Uri
*
xmppCon.Transport = Matrix.Net.Tranport.BOSH;
xmppCon.Uri = new System.Uri("http://server.com/http-bind");
*/
// status and show for Autopresence after login
_xmppClient.Status = "online";
_xmppClient.Show = Matrix.Xmpp.Show.NONE;
/*
* we connect through a HTTP Proxy (HTTP Tunnel) here.
* So the Silverlight port range restriction applies to the ProxyPort, but not to the xmpp port.
*/
_xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.None;
//_xmppClient.ProxyHostname = "matrix.ag-software.de";
//_xmppClient.ProxyHostname = "localhost";
//_xmppClient.ProxyPort = 4503;
_xmppClient.Open();
Regards,
Panos Lambrianides
I am able to connect to an Openfire Server 3.6.4 using the sample application. I get the following exchange which appears fine to me at first glance. I am not sure why the server does not respond back after the password is sent (last SEND below). I am unable to get any further. There is nothing on the server side logs even though it can clearly communicate. Any help would be appreciated.
7:57:29 PM SEND:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="terry" version="1.0" >
7:57:29 PM RECV:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="terry" version="1.0" id="c852e5ec" >
7:57:29 PM RECV:
<stream:features xmlns:stream="http://etherx.jabber.org/streams">
<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>
7:57:29 PM SEND:
<auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">XXX</auth>
Here is the Connect() code:
_xmppClient.Username = login.Jid.User;
_xmppClient.Password = login.Password;
_xmppClient.XmppDomain = login.Jid.Server;
_xmppClient.Transport = Matrix.Net.Tranport.BOSH;
_xmppClient.Uri = new System.Uri("http://192.168.2.16/http-bind/");
_xmppClient.Port = 80;
if (!String.IsNullOrEmpty(login.Hostname))
_xmppClient.Hostname = login.Hostname;
_xmppClient.AutoPresence = false;
_xmppClient.Priority = login.Priority;
/*
* One restriction on using sockets in Silverlight 2 is that the port range that a network application
* is allowed to connect to must be within the range of 4502-4534.
* These are the only ports allowed for connection using sockets from Silverlight 2 applications.
* If a connection is to a port is not within this port range, the connection attempt will fail.
*
* If you connect over HTTP Proxy (see below) then this restriction does not apply to the Xmpp Port
* but it does to the ProxyPort.
*/
//_xmppClient.Port = 5222;
//_xmppClient.Port = 4503;
/*
* if you want to use Bosh then set the tarnsport to Bosh
* an the Uri to the correct Bosh Uri
*
xmppCon.Transport = Matrix.Net.Tranport.BOSH;
xmppCon.Uri = new System.Uri("http://server.com/http-bind");
*/
// status and show for Autopresence after login
_xmppClient.Status = "online";
_xmppClient.Show = Matrix.Xmpp.Show.NONE;
/*
* we connect through a HTTP Proxy (HTTP Tunnel) here.
* So the Silverlight port range restriction applies to the ProxyPort, but not to the xmpp port.
*/
_xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.None;
//_xmppClient.ProxyHostname = "matrix.ag-software.de";
//_xmppClient.ProxyHostname = "localhost";
//_xmppClient.ProxyPort = 4503;
_xmppClient.Open();
Regards,
Panos Lambrianides
This post was edited on 2012-12-14, 13:13 by Alex.