Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
koyakishore #1
Member since May 2014 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Setting xmpp notifications for Google cloud print over the proxy
Hi,

I'm currently working on Google cloud print notifications using Xmpp. I have used agsXmpp SDK to set up and wait for notifications of print jobs in google cloud. I successfully achieved it. Thanks for that.

Now, my next step is to register these notifications when my server is behind the proxy. Well, I have read many posts in this forum which says to use PollClientSocket and BoshClientSocket. But I could not find any luck with both the connections.

Below is code which I used individually for PollClient and BoshClient.

  1. xmpp = new XmppClientConnection();
  2. xmpp.Server = "gmail.com";
  3. xmpp.Username = GCPRequests.AdminUserName;
  4. xmpp.Password = GCPRequests.AdminPassword;
  5. xmpp.AutoResolveConnectServer = true;

//PollSocket
  1. xmpp.ConnectServer = "http://talk.google.com";
  2. xmpp.SocketConnectionType = SocketConnectionType.HttpPolling;
  3. PollClientSocket sock = xmpp.ClientSocket as PollClientSocket;

Error: Invalid Uri

//BoshSocket
  1. xmpp.ConnectServer = "http://talk.google.com/http-bind/";
  2. xmpp.SocketConnectionType = SocketConnectionType.Bosh;
  3. sock = xmpp.ClientSocket as BoshClientSocket;

Error: InvalidTokenException

Rest of the code is...
  1. var uriBuilder = new UriBuilder
  2.                     {
  3.                         Scheme = System.Uri.UriSchemeHttp,
  4.                         Host = "Proxy address",
  5.                         Port = 8xxx
  6.                     };
  7.                     var proxyUri = uriBuilder.Uri;
  8.                     sock.Proxy = new WebProxy()
  9.                     {
  10.                         Address = proxyUri
  11.                     };
  12.                     sock.Proxy.Credentials = new NetworkCredential("Username", "Password");
  13.  
  14. xmpp.Open();


Any help will be greatly appreciated.

Thanks,
Sai Kishore
This post was edited on 2014-05-20, 11:14 by Alex.
Edit reason: fixed code formatting
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Google runs no BOSH connection managers,  and agsXMPP supports no Proxy on socket connections.

I suggest to use our MatriX SDK which supports proxies.
http://www.ag-software.net/matrix-xmpp-sdk/
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:
Forum: agsXMPP RSS