GithubHelp home page GithubHelp logo

poi519 / nan-xmpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zzkt/gibberish

1.0 2.0 0.0 241 KB

A PLT scheme module for the XMPP or Jabber protocol

License: GNU Lesser General Public License v3.0

Racket 100.00%

nan-xmpp's Introduction

XMPP

A production module for IM using the Jabber/XMPP protocol with Racket.

Protocol Support

Should eventually implement XMPP-Core and XMPP-IM to conform with RFCs 3920 and 3921. Progress toward supporting the full protocol is currently documented in the file xmpp.rkt

Installation

(require (planet marune/nan-xmpp))

Session

Sending

Response Handlers

Example Chat Client

#lang racket/base
(require  "../nan-xmpp/main.rkt"
          racket/match)

(define (read-input prompt)
  (display prompt)
  (read-line))

(define jid (read-input "jid: "))
(define password (read-input "password: "))
(define to (read-input "chat to: "))

(define conn (new-connection (jid-host jid)))
(open-session conn jid password)

(define (handler sz)
  (match sz
    ((list 'message _ ...) (print-message sz))
    ((list 'presence _ ...) (print-presence sz))
    (_ 'do-nothing)))

(xmpp-set-handler conn handler)

(let message-loop () 
  (define txt (read-line))
  (unless (string=? txt "/exit")
    (xmpp-send conn (message #:to to #:body txt))                      
    (message-loop)))

(kill-connection! conn)

possibly interesting extensions to implement.

see http://xmpp.org/extensions/

  • XEP-0047: In-Band Bytestreams
  • XEP-0066: Out of Band Data
  • XEP-0030: Service Discovery
  • XEP-0060: Publish-Subscribe
  • XEP-0045: Multi-User Chat (IN PROGRESS)
  • XEP-0149: Time Periods
  • XEP-0166: Jingle
  • XEP-0174: Serverless Messaging
  • XEP-0199: XMPP Ping
  • XEP-0224: Attention
  • XEP-0077: In-Band Registration

nan-xmpp's People

Contributors

poi519 avatar zzkt avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.