All Projects → araditc → Artalk.Xmpp

araditc / Artalk.Xmpp

Licence: MIT license
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.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Artalk.Xmpp

PageSigner
Client for the TLSNotary protocol (Chromium extension).
Stars: ✭ 63 (+50%)
Mutual labels:  tls
safeminer
全网第一款本地连接矿池加密软件,隐藏本地ip、加密数据包、流量混淆,可实现防止被监管的目的
Stars: ✭ 8 (-80.95%)
Mutual labels:  tls
utls
Fork of the Go standard library with unsafe extensions, for expert clients with unusual needs.
Stars: ✭ 19 (-54.76%)
Mutual labels:  tls
vault-pki-monitor-venafi
Venafi PKI Monitoring Secrets Engine for HashiCorp Vault that enforces security policy and provides certificate visiblity to the enterprise.
Stars: ✭ 18 (-57.14%)
Mutual labels:  tls
hyper-proxy
A proxy connector for Hyper-based crates
Stars: ✭ 73 (+73.81%)
Mutual labels:  tls
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+7778.57%)
Mutual labels:  tls
Chromium-Gost
Chromium с поддержкой алгоритмов ГОСТ
Stars: ✭ 286 (+580.95%)
Mutual labels:  tls
p3y
A single binary reverse proxy written in go. It was developed for use in Kubernetes, to wrap services like Prometheus with simple BasicAuth and TLS encryption.
Stars: ✭ 15 (-64.29%)
Mutual labels:  tls
Limnoria
A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins. Successor of the well-known Supybot.
Stars: ✭ 578 (+1276.19%)
Mutual labels:  tls
main
Main repository with patches and required resources
Stars: ✭ 68 (+61.9%)
Mutual labels:  xmpp-client
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (-16.67%)
Mutual labels:  tls
threadproxy.nim
Simplify Nim Inter-Thread Communication
Stars: ✭ 23 (-45.24%)
Mutual labels:  itc
iot security
《密码技术与物联网安全——mbedtls开发实战》示例代码
Stars: ✭ 111 (+164.29%)
Mutual labels:  tls
node-dns-over-tls
DNS-over-TLS API for Node.js
Stars: ✭ 18 (-57.14%)
Mutual labels:  tls
mos-tls-tunnel
Archived. Check this out https://github.com/IrineSistiana/simple-tls
Stars: ✭ 21 (-50%)
Mutual labels:  tls
ToRat client
This is the ToRat client, a part of the ToRat Project.
Stars: ✭ 29 (-30.95%)
Mutual labels:  tls
netxduo
Azure RTOS NetX Duo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
Stars: ✭ 151 (+259.52%)
Mutual labels:  tls
crlite
WebPKI-level Certificate Revocation via Multi-Level Bloom Filter Cascade
Stars: ✭ 52 (+23.81%)
Mutual labels:  tls
SSL-TLS-ECDSA-timing-attack
Timing Attack on TLS' ECDSA signature
Stars: ✭ 41 (-2.38%)
Mutual labels:  tls
sslcli
Pretty awesome command-line client for public SSLLabs API
Stars: ✭ 17 (-59.52%)
Mutual labels:  tls

Artalk.Xmpp

This 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.

NuGet

You can download this package from NuGet

Introduction

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.

Supported XMPP Features

The library fully implements the XMPP Core and XMPP Im 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:

Where to get it

The project is hosted at GitHub and can be found at https://github.com/araditc/Artalk.Xmpp. You can always get the latest binary package on Nuget . The documentation is also available for offline viewing as HTML or CHM .

License

This library is released under the MIT License. It can be used in private and commercial projects.

Bug reports

Please send your bug reports to [email protected] or create a new issue on the GitHub project homepage.

About XMPP

This section provides a brief overview of the architecture of the Extensible Messaging and Presence Protocol (XMPP).

Collapse imageIntroduction

The Extensible Messaging and Presence Protocol (XMPP) is an open XML-based protocol for near-real-time messaging, presence, and request-response services.

The 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.

Collapse imageArchitecture

The 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.

Clients 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 [email protected].

The following diagram provides a general overview of the XMPP architecture:

Xmpp

See Also

Other Resources

XMPP on Wikipedia

##Installation

This quick start shows you how to incorporate the َArtalk.Xmpp assembly into your application.

Getting up and running

  1. 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.
  2. You can now start using the namespaces exposed by the Artalk.Xmpp assembly.

Prerequisites

To complete this quick start, you must have the following components:

  1. Visual Studio 2003 or newer.
  2. A copy of the Artalk.Xmpp.dll assembly.

Getting Started

This section provides a brief overview of the different namespaces and classes exposed by the Artalk.Xmpp assembly.

Artalk.Xmpp.Core

The 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).

As 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.

Artalk.Xmpp.Im

The 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).

In 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.

Artalk.Xmpp.Client

The 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.

Howto: Connect to an XMPP server

The following example demonstrates how to connect to an XMPP server using the ArtalkXmppClient class.

Connecting using an existing XMPP account

If 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:

C#

using Artalk.Xmpp.Client;
using System;
using System.Text.RegularExpressions;

namespace ArtalkTest {
    class Program {
        static void Main(string[] args) {
            string hostname = "artalk.ir";
            string username = "myusername";
            string password = "mysecretpassword";

            using (ArtalkXmppClient client = new ArtalkXmppClient(hostname, username, password)) {
                // Setup any event handlers.
                // ...
                client.Connect();
                
                Console.WriteLine("Type 'quit' to exit.");
                while (Console.ReadLine() != "quit");
            }
        }
    }
}

Send Message

client.SendMessage(recipient, message);

Using 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.

Howto: Setup XMPP event handlers

The following example demonstrates how to set up event handlers for the events exposed by the ArtalkXmppClient class.

Hooking up to events

  1. 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:
 using Artalk.Xmpp.Client;
 using System;
 
 namespace ArtalkTest {
     class Program {
         static void Main(string[] args) {
             string hostname = "artalk.ir";
             string username = "myusername";
             string password = "mypassword";
 
             using (XmppClient client = new XmppClient(hostname, username, password)) {
                 // Setup any event handlers before connecting.
                 client.Message += OnNewMessage;
                 // Connect and authenticate with the server.
                 client.Connect();
 
                 Console.WriteLine("Type 'quit' to exit.");
                 while (Console.ReadLine() != "quit");
             }
         }
 
         /// <summary>
         /// Invoked whenever a new chat-message has been received.
         /// </summary>
         static void OnNewMessage(object sender, MessageEventArgs e) {
             Console.WriteLine("Message from <" + e.Jid + ">: " + e.Message.Body);
         }
     }
 }
  1. Whenever a chat-message is sent to [email protected], the OnNewMessage method will be invoked. The MessageEventArgs parameter contains information about the sender of the message as well its content.

Robust Programming

Event handlers are invoked sequentially on a separate thread.

You 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 method of the respective UI control to have the control updated on the thread that owns the control's underlying window handle.

Donate

Donate

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].