So, I struggled to find a decent C # library for use with XMPP that supports SSL or TSL encryption between clients and server. I hope someone can recommend me a library that satisfies some of my needs and is pretty well supported / documented. Also, maybe someone can confirm my suspicions about some of the libraries that I have already tried.
My first attempt was using the Soapbox Studio SDK. Found here from Conversant , however, from what I can say, they only support SASL authentication. I tried to contact them, but did not receive a response, and the forum there did not seem to work, because I could not post my question on my forum. Perhaps I am mistaken in my assumption of SSL using the Soapbox library, which would be great if someone could fix me, because it is a library that I would prefer to use.
Then I moved on to the matrix, which is the successor to agXmpp. After several days of trolling my bulletin boards and going through their sample applications, I can't even get to create a group chat on my openfire server. Almost all related questions are hosted on ag Software formum so people can use their sample applications to answer their questions. However, if I don’t understand something, many of their sample applications look outdated or unsuitable for my needs. The following code is an example of my attempt to use their libraries to create group chat. If someone used their library, maybe they can indicate what I'm doing wrong.
These are my governing directives.
using System;
using Matrix.Xmpp.Disco;
using Matrix.Xmpp.Client;
using Matrix.Xmpp.Session;
using Matrix.Xmpp;
using Matrix;
Here is the code that connects to the Xmpp client
readonly XmppClient _xmppClient = new XmppClient();
public string Connect() {
try
{
_xmppClient.SetUsername(OPENFIRE_USER_NAME);
_xmppClient.Password = OPENFIRE_PASSWORD;
_xmppClient.SetXmppDomain(OPENFIRE_SERVER);
_xmppClient.Show = Matrix.Xmpp.Show.chat;
_xmppClient.AutoRoster = true;
_xmppClient.Open();
return "Connection Succesful";
}
catch (Exception ex)
{
_logger.LogError("SessionManager", "Connect", "Could not connect to Openfire Server", ex.ToString());
return "Could not Connect to Openfire Server";
}
}
and this is the code that should create a new chat
public string CreateRoom(string roomName, string serverName, string userName)
{
Jid groupJid = new Jid(userName, serverName, "gec2o");
using (MucManager mucManager = new MucManager(_xmppClient))
{
mucManager.EnterRoom(groupJid, roomName, true);
mucManager.RequestInstantRoom(groupJid);
}
return "";
}
- . , , , openfire. , , , , / . , , , , soapbox, , , (, ).
, jabber-net, , , , Soapbox Matrix .
IP * Works Internet Toolkit, , -, .
, , , , . , - , , .