Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
JoeT #1
Member since Oct 2011 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Using http when hostname and domain are different...
I'm wondering how the tutorial example of BOSH would look different if the domain and hostname properties of the xmpp client are different.

    xmppClient.SetUsername("username");
    xmppClient.SetXmppDomain("ag-software.de");
    xmppClient.Password = "secret";
    xmppClient.Transport = Matrix.Net.Transport.BOSH;
    xmppClient.Uri = new System.Uri("http://ag-software.de:5280/http-bind/");
    xmppClient.Status = "I'm chatty";
    xmppClient.Show = Matrix.Xmpp.Show.chat;
    xmppClient.Open();

All that would need to be done is set the Hostname property?

    xmppClient.SetUsername("username");
    xmppClient.SetXmppDomain("ag-software.de");
    xmppClient.Password = "secret";
    xmppClient.Transport = Matrix.Net.Transport.BOSH;
    /****/xmppClient.Hostname = "187.23.45.62";
    xmppClient.Uri = new System.Uri("http://ag-software.de:5280/http-bind/");
    xmppClient.Status = "I'm chatty";
    xmppClient.Show = Matrix.Xmpp.Show.chat;
    xmppClient.Open();

or does the Uri have to change as well?

Second question - is it possible for a server to not require a password for a client connecting?  If so, should the password field be set to an empty string or something like that?
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by JoeT:
I'm wondering how the tutorial example of BOSH would look different if the domain and hostname properties of the xmpp client are
or does the Uri have to change as well?

sorry, I don't understand your question, can you please elaborate?

Quote by JoeT:
Second question - is it possible for a server to not require a password for a client connecting?  If so, should the password field be set to an empty string or something like that?

Some servers allow anonymous login. With anonymous login you don't need a username and a password. The server creates an anonymous temporary user for each login then. If you want to login  with a username but no password you probably have to patch your server to ignore the password. When you describe us your use case then we can suggest you a solution for this when there is any.
Avatar
JoeT #3
Member since Oct 2011 · 12 posts
Group memberships: Members
Show profile · Link to this post
In the tutorial for using BOSH, the "Hostname" property is not used.  I'm wondering if the Hostname property is set, would that sample code look exactly the same?  e.g. would the xmppClient.Uri property still be the same if the Hostname were set to [something other than ag-software.de]?
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You don't need the Hostname property for Bosh, only the Uri. Http URLs include the Hostname.

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: