Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
zeroreality #1
Member since Aug 2009 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Problem Run Sample Program
I am running the sample matrix client, with the Policy Server and can't seen to connect to an Openfire server on the same machine.

I am using visual studio 2008
Silverlight 3 sdk (I suspect this may be why)

I know silverlight has a port range limitation and cannot connect across hosts.

Setting Openfire client connect to 4502 didn't work with and without the Policy Server and just the Policy Server didn't work.

I am out of ideas to try.

The example program is nice but there are not setup instructions, is that simple and i missing something?
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi zeroreality,

  • have you change the Port in the Openfire configuration?
  • Have to tried to connect to the Openfire server at this port with an existing client like Psi?
  • Because of the cross domain policy the domain you use for XMPP and your webserver must match. So if you test you code on http://localhost/Test.html then you should also connect under localhost to your xmpp server.

Alex
This post was edited on 2012-01-31, 20:47 by Alex.
Avatar
Raghu #3
Member since Jan 2010 · 1 post · Location: India
Group memberships: Members
Show profile · Link to this post
Hi Alex,

I tried all the ways which u suggested above even though Im not able to connect to XMPP Server.

Even policy server also not invoking after started running Silverlight application. Is anything i need to change in clientaccesspolicy.xml page in Policy Server application?

Please check these steps I followed:

    _xmppClient.Username = login.Jid.User;
            _xmppClient.Password = login.Password;
           
            _xmppClient.XmppDomain = login.Jid.Server;
            _xmppClient.Port = 4502;

            if (!String.IsNullOrEmpty(login.Hostname))
                _xmppClient.Hostname = login.Hostname;
           
            _xmppClient.AutoPresence = false;
            _xmppClient.Priority = login.Priority;
           
           //_xmppClient.Port = 5222;
            _xmppClient.Port = 4502;

            _xmppClient.Status  = "online";
            _xmppClient.Show    = Matrix.Xmpp.Show.NONE;

            //_xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.HttpTunnel;
            _xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.None;
            _xmppClient.ProxyPort = 4503;

            _xmppClient.Open();


Please help me how to connect to XMPP?.
This post was edited on 2010-01-20, 12:56 by Raghu.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
here is a good MSDN article which explains the network security access restrictions in Silverlight
http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx

This article talsk in the most sections about 2 options

  • A) WebRequests (in MatriX and XMPP direct connection)
  • B) sockets (in MatriX and XMPP BOSH connection)

In MatriX you can either use Sockets (direct connection) or WebRequests (BOSH). This MSDN article should dive you a good overview of the options you have with your server setup and find the best solution for you.
Avatar
mw #5
Member since Feb 2010 · 4 posts · Location: West Hollywood
Group memberships: Members
Show profile · Link to this post
Frankly it would make sense to have a document that demonstrates the necessary configuration settings to make a server like openfire work with the silverlight chat. I have spent the last couple of hours trying to get this to work without avail. In addition to that it would be great if you could add a quirks mode to fix the BOSH issue in openfire you mentioned in another thread. I think that the xmpp technology you created here is very good but I don't even get there because I cannot get a connection to the server and that is very frustrating.

Martin
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The ReadMe which ships with MatriX and this blog entry should help to get a running environment:
http://blog.ag-software.de/?p=92

Its on my todo list to create video tutorials, more documentation or VMWare images for that. But currently I am too busy with other customer projects to finish this task.

I suggest to start with direct socket connection:
1) Setup a XMPP server like openfire or ejabberd
2) change the port in the XMPP server to a port within the Silverlight port range.
3) restart the XMPP server
4) start the policy server
5) set XmppDomain, port, username and password to a account on your server and connect.

Quote by mw:
In addition to that it would be great if you could add a quirks mode to fix the BOSH issue in openfire you mentioned in another thread.
at the moment i see no reason for this. An Openfire Patch which should fit the problem is available in the code repository. If this stops somebody to go live with teh software then I am pretty sure that we can find a solution with a custom version. Hacks don't help here because buggy software should be fixed.

Alex
Avatar
mw #7
Member since Feb 2010 · 4 posts · Location: West Hollywood
Group memberships: Members
Show profile · Link to this post
Thank you,
the blog was actually much more helpful than the readme.
I followed steps 1 -5 today, ensured that the clientaccess policy file is reachable under the domain root, both on port 80 and 943 (as noted in your blog) but I still get an empty chat window and nothing in the debug window (i am using the small silverlight chat sample). I tested the server with psi and it worked fine there. I use apache2 to render the policy file, the chat server is a linux machine (ubuntu) with openfire and MSSQL database server.

Martin
Avatar
Alex #8
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • If you connect with BOSH you must host a poliy xml on the webserver
  • I you connect with sockets you must run a policy socket server.

With BOSH you must host a policy xml file on the root of the webserver where the Silverlight application gets downloaded. You can't debug with the build it webserver from Visual Studio and host the policy on another web server.

The same applies to sockets. Silverlight contacts a policy server under the same target as the socket. If I want to connect a socket to my openfire server on myopenfire.org:4502 then the policy requests goes to myopenfire.org:943

In your case when you use BOSH and host the policy on Apache you must use mod_proxy to forward all Bosh requests to openfire.
If oyu use sockets you must run a policy servr on your Ubuntu machine or use port forwarding technologies to forward the requests to another machine where a policy server is running.

Alex
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: