Posted by gnauck on May 25, 2011
Today Microsoft has released the Beta Tools for Mango. Mango delivers many new features to Windows Phone developers. The two features we were waiting for are the following:
- Background processing
- Networking / sockets for communications
Now you are also able to use sockets instead of BOSH as transport layer on Windows Phone Mango. And your XMPP apps are able to run in background and keep your XMPP connection alive for listening asynchronous on events. This is a big step forward for XMPP and Instant Messaging apps on Windows Phone.
I have implemented sockets in MatriX for Windows Phone. You can download the MatriX beta release for Mango here.
Posted by gnauck on March 25, 2011
I am happy to announce release 1.4 of the MatriX XMPP libraries. There are many minor and major improvements. Here is a small list of changes
- Silverlight version updated to Silverlight 4.0
- added ability in Silverlight to download policies over HTTP instead of sockets (new feature in SL4)
- try to connect to all hosts in the SRV records and all IP adresses when tehre are multiple addresses assigned (full .NET version only)
- added DIGEST-MD5 to Silverlight and WP7 version (yes there are still many servers which require this SASL mechanism)
- added non SASL authentication
- XEP-0033 extended stanza addressing
You can download the new versions here
Posted by gnauck on January 29, 2011
From now all upcoming releases of MatriX for Silverlight will be compiled against Silverlight 4 because of improvements in the security policy system.
Since Silverlight 4 a connection request using sockets can choose to retrieve the policy file via the HTTP protocol on TCP port 80 instead of the custom TCP protocol on port 943. Web servers are already running in mosts environments. This makes your setup much easier because you don’t need the special policy server on port 943.
To enable policy download over HTTP use the following code in the latest MatriX for Silverlight version.
XmppClient.DownloadClientAccessPolicyViaHttp = true;
You can read more details about the Network Security Access Restrictions in Silverlight here in the MSDN
Posted by gnauck on November 26, 2010
Because many Windows users are not familiar with tools like nslookup, dig and SRV records I have created a small GUI tool to lookup XMPP SRV Records on Windows.
You can download the tool from the following link.
The .NET Framework 4 Client Profile is required to run this tool.
Screenshot - SRV Record Tester
Posted by gnauck on October 31, 2010
The Unclassified NewsBoard (short UNB) ist a great, fast and lightweight forums software which is very easy to extend and customize. I use it for many years now. UNB was the 1st board software with XMPP notifications for new replies in threads or users.
I have written now a small plugin which notifies board admins of new created threads. There is no need to poll the RSS feed every X minutes or hours anymore.
You can find the plugin here.
Posted by gnauck on August 4, 2010
there were no blog posts for a while because I was too very busy with coding.
I released MatriX 1.3 for .NET some days ago. This release includes many new features.
To name only some of the latest updates:
- SASL EXTERNAL
- SASL SCRAM-SHA-1
- file tranfer control
- XPath filering
- roster versioning
Yesterday I successfully compiled and tested MatriX on Windows Phone 7. MatriX for Windows Phone will be the next product to complete the MatriX series released very soon.
If you plan to develop XMPP apps for WP7 or need a XMPP layer for WP7 feel free to contact me.
Posted by gnauck on March 12, 2010
XPath support for my XMPP libraries was on my TODO list for a long time. Because agsXMPP is using its own DOM implementation I wasn’t able to use standard XPath libraries. Writing a custom XPath implementation is quite a challenge, and using System.Xml’s XPath functions would require 2 different DOMs and parsing the Xml twice, which was no option for me.
Because MatriX is using System.Xml.LinQ which has XPath support it was pretty easy to get this task done for MatriX now.
Of course you can do filtering based on powerful LinQ statements and the other filter classes in MatriX. But in many cases it’s required to build expressions dynamically on the fly. Also many programmers are familiar with XPath and prefer XPath over LinQ statements. The XPathFilter makes it also much easier to filter big complex stanzas with many nested elements.
The following example describes the usage of the XPathFilter. We setup a filter that matches all presence stanzas from the full Jid ‘firstname.lastname@example.org/MatriX’. Because MatriX and XPath in .Net are namespace aware we have to define prefixes in the XmlNamespaceManager. Otherwise we would get no results.
e.Stanza is the complete stanza which matches the expression.
e.Result is the result of the XPath expression. This is useful when you are interested only in fragments of the complete stanza.
void XPathCallback(object sender, XPathEventArgs e)
Debug.WriteLine("Stanza: " + e.Stanza);
Debug.WriteLine("Result: " + e.Result);
Here are some other XPath example expressions to filter stanzas:
- filter all messages with the exact body of 'Hello MatriX
- filter all presences where the Jid starts with 'gnauck@'.
- filter all messages of type=error which have a from and and a to Jid
/JC:message[@from and @to and @type='error']
Posted by gnauck on March 10, 2010
I am pleased to announce a new MatriX releases. All 3 MatriX editions were updated to
184.108.40.206 and are in sync with the version number now.
This release includes also the first version of the MatriX developer guide with many code examples. I will add continuous more content, code snippets and examples to this guide.
Download the new releases from here.
Posted by gnauck on January 29, 2010
It looks like many developers have problems to setup and debug Silverlight applications with MatriX.
There are different ways to setup a XMPP connection with MatriX
- direct socket connection on a port within the Silverlight port range
- direct connection over a HTTP proxy with the CONNECT command (HTTP tunneling)
- BOSH connection
Silverlight has different network security access restrictions for sockets and web requests. If you choose option 1 or 2 then the socket policies apply, if you choose 3 then the web request policy apply because MatriX is using .NET WebRequest classes for the connections. Read more details about the Silverlight network security access restrictions here.
Silverlight allows socket connections only on ports 4502-4534. For option 1 and 2 this means you have to configure your XMPP or proxy server to listen on a port within this port range, or use other technologies like port forwarding to redirect connections to the XMPP default port 5222. Before a socket can be connected the Silverlight runtime requests the policy on the target site at port 943 and checks the permissions.You have to run a policy server which must be able to serve requests on the same domain as your XMPP or proxy server is hosted.
When using BOSH and crossing domains the Silverlight runtime requests a policy xml file from the root of the BOSH Uri. This means you can connect to other XMPP servers (not under your control) only if they host a policy file on the root of the BOSH Uri which allows you to connect. Or you run your own BOSH server which is able to connect to any XMPP server in the federated network. Punjab is a good choice for the latter.
when the BOSH Uri is http://example.com:5280/http-bind/ the Silverlight runtime request either a Flash policy file at http://example.com:5280/crossdomain.xml or a Silverlight policy file at http://example.com:5280/clientaccesspolicy.xml when crossing domains.
To avoid cross domain requests on your own server you can either
Crossing domains would be much easier if all BOSH components allow you to serve the policy files at the root of the BOSH Uri.
- choose a XMPP server which allows you to host your application on the BOSH Uri
- proxy from your web server to the BOSH server e.g. with mod_proxy in Apache.
All this policy stuff makes not much sense to me, but this is what Adobe and Microsoft came up with. So we have to deal with it.
Posted by gnauck on January 4, 2010
I am pleased to announce the availability of MatriX Mobile for the .NET Compact Framework. This is the 3rd product in the MatriX series. Now MatriX is available for all major .NET platforms.
- full .NET Framework
- .NET Compact Framework
This allows you to use one API for Desktop, Mobile and Web Development and reuse lots of your code to shorten your development time.
Download Matrix here.