Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
sugi #1
Member since Nov 2011 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: BOSH through proxy server
I have a problem that the MatriX(.NET) cannot connect the BOSH Server through a proxy server from client program.

In case that the parameter of "Transport" is "Matrix.Net.Transport.BOSH", it seems to connect not the proxy server but BOSH Server directly.
We expect to connect the BOSH Server through the proxy server.

The sample code is attached as follows;

  1. this.xmppClient.SetUsername("UserName");
  2. this.xmppClient.SetXmppDomain("XX.XX.XX.XX");
  3. this.xmppClient.Password = "PasswordText";
  4. this.xmppClient.Hostname = "XX.XX.XX.XX";
  5.  
  6. this.xmppClient.Transport = [color=blue]Matrix.Net.Transport.BOSH;[/color]
  7. this.xmppClient.Uri = new System.Uri("http://XX.XX.XX.XX:7070/http-bind/");
  8. this.xmppClient.Port = 7070;
  9.  
  10. this.xmppClient.ProxyHostname = textProxyServer.Text;
  11.  
  12. // proxy settings
  13. this.xmppClient.ProxyHostname = "proxy.server.address";
  14. this.xmppClient.ProxyPort = int.Parse("8080");
  15. this.xmppClient.ProxyUser = "ProxyUserName";
  16. this.xmppClient.ProxyPass = "ProxyPassword";
  17. this.xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.HttpTunnel;
  18.  
  19.  
  20. this.xmppClient.Status = "ready for chat";
  21. this.xmppClient.Show = Matrix.Xmpp.Show.chat;
  22.  
  23. this.xmppClient.Open();


Is there any problems?

If you have some sample codes, could we get them please?
This post was edited on 2012-01-31, 19:48 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by sugi:
this.xmppClient.ProxyHostname = textProxyServer.Text;

// proxy settings
this.xmppClient.ProxyHostname = "proxy.server.address";
this.xmppClient.ProxyPort = int.Parse("8080");
this.xmppClient.ProxyUser = "ProxyUserName";
this.xmppClient.ProxyPass = "ProxyPassword";
this.xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.HttpTunnel;

these properties apply only to Sockets.

Bosh is using .NET WebRequests. There is an event OnCreateWebRequest. This event passes the WebRequest object which MatriX created. In this event you can set your Proxy, Cookies and all other stuff you need to the Webrequest.

Alex
Avatar
sugi #3
Member since Nov 2011 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thank you!
We can solve it!
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: