{"id":28448564,"url":"https://github.com/araditc/artalk.xmpp","last_synced_at":"2025-07-01T02:32:27.355Z","repository":{"id":46548078,"uuid":"222074320","full_name":"araditc/Artalk.Xmpp","owner":"araditc","description":"This repository contains an easy-to-use and well-documented .NET (Framework and Core 3.1, .Net 5 and .Net 6) assembly for communicating with an XMPP server. It supports basic Instant Messaging and Presence funtionality as well as a variety of XMPP extensions.","archived":false,"fork":false,"pushed_at":"2022-11-15T06:46:01.000Z","size":1004,"stargazers_count":56,"open_issues_count":11,"forks_count":26,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-06T13:09:11.380Z","etag":null,"topics":["architecture","itc","presence-funtionality","presence-protocol","tls","xmpp-assembly","xmpp-client","xmpp-extensions","xmpp-server"],"latest_commit_sha":null,"homepage":"https://www.artalk.im","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/araditc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-16T09:13:02.000Z","updated_at":"2024-11-05T06:48:50.000Z","dependencies_parsed_at":"2023-01-21T18:45:11.036Z","dependency_job_id":null,"html_url":"https://github.com/araditc/Artalk.Xmpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/araditc/Artalk.Xmpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araditc%2FArtalk.Xmpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araditc%2FArtalk.Xmpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araditc%2FArtalk.Xmpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araditc%2FArtalk.Xmpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/araditc","download_url":"https://codeload.github.com/araditc/Artalk.Xmpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araditc%2FArtalk.Xmpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262883764,"owners_count":23379250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","itc","presence-funtionality","presence-protocol","tls","xmpp-assembly","xmpp-client","xmpp-extensions","xmpp-server"],"created_at":"2025-06-06T13:09:11.426Z","updated_at":"2025-07-01T02:32:27.344Z","avatar_url":"https://github.com/araditc.png","language":"C#","funding_links":["https://paypal.me/araditcco?locale.x=en_US"],"categories":[],"sub_categories":[],"readme":"# Artalk.Xmpp\nThis repository contains an easy-to-use and well-documented .NET assembly for communicating with an XMPP server. It supports basic Instant Messaging and Presence funtionality as well as a variety of XMPP extensions.\n\n### NuGet \nYou can download this package from [NuGet](https://www.nuget.org/packages/Artalk.Xmpp/)\n\n# Introduction\n\n**Artalk Xmpp** is an easy-to-use and well-documented .NET assembly for communicating with an XMPP server. It supports basic Instant Messaging and Presence funtionality as well as a variety of XMPP extensions.\n\n\n# Supported XMPP Features\n\nThe library fully implements the  [XMPP Core](http://xmpp.org/rfcs/rfc3920.html)  and  [XMPP Im](http://xmpp.org/rfcs/rfc3920.html)  specifications and thusly provides the basic XMPP instant messaging (IM) and presence functionality. In addition, the library offers support for most of the optional protocol extensions. More specifically, the following features are supported:\n\n-   TLS/SSL Support\n-   [SASL Authentication](http://www.ietf.org/rfc/rfc4422.txt)  (PLAIN, DIGEST-MD5, and SCRAM-SHA-1)   \n-   [User Avatars](http://xmpp.org/extensions/xep-0084.html)\n-   [SOCKS5](http://xmpp.org/extensions/xep-0065.html)  and  [In-Band](http://xmpp.org/extensions/xep-0047.html)  File-Transfer   \n-   [In-Band Registration](http://xmpp.org/extensions/xep-0077.html)   \n-   [User Mood](http://xmpp.org/extensions/xep-0107.html)   \n-   [User Tune](http://xmpp.org/extensions/xep-0118.html)\n-   [User Activity](http://xmpp.org/extensions/xep-0108.html)\n-   [Simplified Blocking](http://xmpp.org/extensions/xep-0191.html)\n\n# Where to get it\n\nThe project is hosted at GitHub and can be found at  [https://github.com/araditc/Artalk.Xmpp](https://github.com/araditc/Artalk.Xmpp).\nYou can always get the latest binary package on  [Nuget](https://www.nuget.org/packages/Artalk.Xmpp/) . The documentation is also available for offline viewing as HTML or CHM .\n\n# License\n\nThis library is released under the  MIT License. It can be used in private and commercial projects.\n\n# Bug reports\n\nPlease send your bug reports to  [bugs@arad-itc.org](mailto:bugs@arad-itc.org)  or create a new issue on the GitHub project homepage.\n\nAbout XMPP\n\nThis section provides a brief overview of the architecture of the Extensible Messaging and Presence Protocol (XMPP).\n\n# ![Collapse image](http://smiley22.github.io/S22.Xmpp/Documentation/icons/collapse_all.gif)Introduction\n\nThe Extensible Messaging and Presence Protocol (XMPP) is an open XML-based protocol for near-real-time messaging, presence, and request-response services.\n\nThe protocol was originally named Jabber, and was developed by the Jabber open-source community in 1999 for near real-time, instant messaging (IM), presence information, and contact list maintenance. Designed to be extensible, the protocol has also been used for publish-subscribe systems, signalling for VoIP, video, file transfer, gaming, Internet of Things applications such as the smart grid, and social networking services.\n\n# ![Collapse image](http://smiley22.github.io/S22.Xmpp/Documentation/icons/collapse_all.gif)Architecture\n\nThe XMPP network uses a client–server architecture (clients do not talk directly to one another). However, it is decentralized—by design, there is no central authoritative server, as there is with services such as AOL Instant Messenger or Windows Live Messenger.\n\nClients send and receive messages only to and from their respective server and it is the server's responsibility to route appropriately-addressed messages through the network to the intended user. For this purpose, every user on the network has a unique Jabber ID (usually abbreviated as  **JID**  ). To avoid requiring a central server to maintain a list of IDs, the JID is structured like an email address with a username and a domain name for the server where that user resides, separated by an at sign (@), such as username@example.com.\n\nThe following diagram provides a general overview of the XMPP architecture:\n\n![Xmpp](https://raw.githubusercontent.com/araditc/Artalk.Xmpp/master/xmpp.png)\n\n# See Also\n\n#### Other Resources\n[XMPP on Wikipedia](http://en.wikipedia.org/wiki/XMPP)\n\n##Installation\n\nThis quick start shows you how to incorporate the َArtalk.Xmpp assembly into your application.\n\n### Getting up and running\n\n1.  Add a reference to the Artalk.Xmpp assembly: Open your project in Visual Studio and, in Solution Explorer, right-click References, and then click Add Reference. Locate Artalk.Xmpp.dll and add it.\n2.  You can now start using the namespaces exposed by the Artalk.Xmpp assembly.\n    \n ## Prerequisites\n\n### To complete this quick start, you must have the following components:\n\n1.  Visual Studio 2003 or newer.    \n2.  A copy of the Artalk.Xmpp.dll assembly.\n\n# Getting Started\n\nThis section provides a brief overview of the different namespaces and classes exposed by the Artalk.Xmpp assembly.\n\n# Artalk.Xmpp.Core\n\nThe  Artalk.Xmpp.Core  namespace contains basic client-side components that provide a general framework for exchanging structured information in the form of XML data elements between any two network endpoints and correlates closely to the  _Extensible Messaging and Presence Protocol (XMPP): Core_ specification ([RFC 3920](http://xmpp.org/rfcs/rfc3920.html)).\n\nAs such, the classes of the  Artalk.Xmpp.Core  namespace provide building blocks for creating custom communication protocols based on the core XMPP concepts of XML streams and XML stanzas.\n\n# Artalk.Xmpp.Im\n\nThe  Artalk.Xmpp.Im  namespace contains components that implement the basic instant messaging (IM) and presence functionality defined in the  _Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence_ specification ([RFC 3921](http://xmpp.org/rfcs/rfc3921.html)).\n\nIn other words,  Artalk.Xmpp.Im  provides a lean \"bare bones\" XMPP client that implements the minimum feature set that is expected from a conforming implementation. It can be used in situations where a full-scale implementation with support for various XMPP protocol extensions is not neccessary, and can also be used as a basis for creating XMPP clients that implement only a select set of extensions.\n\n# Artalk.Xmpp.Client\n\nThe  Artalk.Xmpp.Client  namespace contains components that built on-top the classes of the  Artalk.Xmpp.Im  and the  Artalk.Xmpp.Core  namespaces to implement a feature-rich XMPP client.\n\n# Howto: Connect to an XMPP server\nThe following example demonstrates how to connect to an XMPP server using the  ArtalkXmppClient class.\n\n# Connecting using an existing XMPP account\n\nIf you already have an account on the server to which you want to connect, establishing a connection is as easy as initializing a new instance of the  ArtalkXmppClient  class und calling the  Connect  method as demonstrated in the following example application:\n\n### C#\n\n```C#                               \nusing Artalk.Xmpp.Client;\nusing System;\nusing System.Text.RegularExpressions;\n\nnamespace ArtalkTest {\n    class Program {\n        static void Main(string[] args) {\n            string hostname = \"artalk.ir\";\n            string username = \"myusername\";\n            string password = \"mysecretpassword\";\n\n            using (ArtalkXmppClient client = new ArtalkXmppClient(hostname, username, password)) {\n                // Setup any event handlers.\n                // ...\n                client.Connect();\n                \n                Console.WriteLine(\"Type 'quit' to exit.\");\n                while (Console.ReadLine() != \"quit\");\n            }\n        }\n    }\n}\n```\n\n### Send Message\n\n```C#\nclient.SendMessage(recipient, message);\n```\nUsing the constructor of the ArtalkXmppClient class as in the example above will automatically negotiate TLS/SSL encryption if the server supports it, however this behaviour can be disabled by passing the constructor a value of false for the tls parameter.\n\n## Howto: Setup XMPP event handlers\n\nThe following example demonstrates how to set up event handlers for the events exposed by the  ArtalkXmppClient  class.\n\n### Hooking up to events\n\n1.  The  ArtalkXmppClient  class exposes a variety of events that can be subscribed to in order to be notified of the receipt of new chat messages, status changes of a chat contact, incoming authorization requests, etc. The following piece of example code shows how to hook up to the  Message  event in order to be notified of the receipt of new chat-messages:\n    \n   ```C#\n\n    using Artalk.Xmpp.Client;\n    using System;\n    \n    namespace ArtalkTest {\n        class Program {\n            static void Main(string[] args) {\n                string hostname = \"artalk.ir\";\n                string username = \"myusername\";\n                string password = \"mypassword\";\n    \n                using (XmppClient client = new XmppClient(hostname, username, password)) {\n                    // Setup any event handlers before connecting.\n                    client.Message += OnNewMessage;\n                    // Connect and authenticate with the server.\n                    client.Connect();\n    \n                    Console.WriteLine(\"Type 'quit' to exit.\");\n                    while (Console.ReadLine() != \"quit\");\n                }\n            }\n    \n            /// \u003csummary\u003e\n            /// Invoked whenever a new chat-message has been received.\n            /// \u003c/summary\u003e\n            static void OnNewMessage(object sender, MessageEventArgs e) {\n                Console.WriteLine(\"Message from \u003c\" + e.Jid + \"\u003e: \" + e.Message.Body);\n            }\n        }\n    }\n```\n\n2.  Whenever a chat-message is sent to myusername@artalk.ir, the OnNewMessage method will be invoked. The  MessageEventArgs  parameter contains information about the sender of the message as well its content.\n    \n\n# Robust Programming\n\n**Event handlers are invoked sequentially on a separate thread.**\n\nYou should not call blocking methods from within event handlers and you must not directly update UI controls from within an event handler. Rather, you should call the  [Invoke](http://msdn.microsoft.com/en-us/library/zyzhdc6b(v=vs.110).aspx)  method of the respective UI control to have the control updated on the thread that owns the control's underlying window handle.\n\n\n\n# Donate\n\n[Donate](https://paypal.me/araditcco?locale.x=en_US)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraditc%2Fartalk.xmpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faraditc%2Fartalk.xmpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraditc%2Fartalk.xmpp/lists"}