{"id":46095254,"url":"https://github.com/meszmate/xmpp-go","last_synced_at":"2026-03-01T18:34:56.512Z","repository":{"id":336882087,"uuid":"1151235606","full_name":"meszmate/xmpp-go","owner":"meszmate","description":"A production-grade XMPP library for Go supporting both client and server roles with a plugin architecture covering 50+ XEPs.","archived":false,"fork":false,"pushed_at":"2026-02-26T16:32:38.000Z","size":251,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-26T22:52:09.214Z","etag":null,"topics":["golang","jabber","omemo","xmpp","xmpp-client","xmpp-server"],"latest_commit_sha":null,"homepage":"","language":"Go","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/meszmate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T08:05:09.000Z","updated_at":"2026-02-26T16:32:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meszmate/xmpp-go","commit_stats":null,"previous_names":["meszmate/xmpp-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/meszmate/xmpp-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meszmate%2Fxmpp-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meszmate%2Fxmpp-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meszmate%2Fxmpp-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meszmate%2Fxmpp-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meszmate","download_url":"https://codeload.github.com/meszmate/xmpp-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meszmate%2Fxmpp-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29978863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","jabber","omemo","xmpp","xmpp-client","xmpp-server"],"created_at":"2026-03-01T18:34:56.437Z","updated_at":"2026-03-01T18:34:56.502Z","avatar_url":"https://github.com/meszmate.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xmpp-go\n\nA comprehensive, production-grade XMPP library for Go supporting both client and server roles with a plugin architecture covering 50+ XEPs.\n\n## Features\n\n- Unified client/server `Session` type\n- Plugin architecture with dependency resolution\n- Streaming XML parser optimized for XMPP\n- Multiple transports: TCP, WebSocket, BOSH\n- Full SASL support: PLAIN, SCRAM-SHA-1/256/512 (+PLUS), EXTERNAL, ANONYMOUS\n- STARTTLS with certificate verification\n- Stanza multiplexer with middleware support\n- DNS SRV and host-meta resolution\n- Pluggable storage backends: Memory, File, SQLite, PostgreSQL, MySQL, MongoDB, Redis\n\n## Installation\n\n```bash\ngo get github.com/meszmate/xmpp-go\n```\n\n## Docker / Compose\n\nThis repo ships a ready-to-run server binary in `cmd/xmppd` with Docker and Compose support.\n\nQuick start (self-signed TLS, file storage, default accounts):\n\n```bash\ndocker compose --profile xmpp up --build\n```\n\nThe default config lives in `docker/xmppd.env`. Common overrides:\n\n- `XMPP_DOMAIN` (default `example.com`)\n- `XMPP_STORAGE` (`file|sqlite|postgres|mysql|mongodb|redis|memory`)\n- `XMPP_STORAGE_DSN` (for DB backends)\n- `XMPP_PLUGINS` (comma list or `all`)\n- `XMPP_DEFAULT_ACCOUNTS` (`user:pass,user2:pass`)\n- `XMPP_TLS_SELF_SIGNED=true` (auto-generate certs)\n\nServer-side XEP-0077 registration is supported and configurable via:\n- `XMPP_REGISTRATION_POLICY` (`open|closed|invite|admin`)\n- `XMPP_REGISTRATION_FIELDS` (comma list, e.g. `username,password,email`)\n- `XMPP_REGISTRATION_INVITES` (comma list of invite tokens)\n- `XMPP_REGISTRATION_ADMIN_TOKENS` (comma list)\n- `XMPP_REGISTRATION_RATE_LIMIT` (requests per window)\n- `XMPP_REGISTRATION_RATE_WINDOW` (Go duration, e.g. `1m`)\n- `XMPP_REGISTRATION_SCRAM_ITERATIONS` (default `4096`)\n- `XMPP_REGISTRATION_DATAFORM` (`true|false`)\n\nTo use a database, enable the matching profile and set `XMPP_STORAGE` + `XMPP_STORAGE_DSN`:\n\n```bash\ndocker compose --profile xmpp --profile postgres up --build\n```\n\nGHCR image publishing is wired via `.github/workflows/docker.yml` and publishes to `ghcr.io/meszmate/xmpp-go`.\n\nCI notes:\n- No GoReleaser is used. Docker publishing is handled by GitHub Actions and pushes to GHCR on `main` and tags.\n- `docker-compose.yml` uses `ghcr.io/meszmate/xmpp-go:latest` by default.\n\nPull from GHCR (after CI pushes):\n\n```bash\ndocker pull ghcr.io/meszmate/xmpp-go:latest\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log\"\n\n    xmpp \"github.com/meszmate/xmpp-go\"\n    \"github.com/meszmate/xmpp-go/jid\"\n    \"github.com/meszmate/xmpp-go/stanza\"\n    \"github.com/meszmate/xmpp-go/plugins/disco\"\n    \"github.com/meszmate/xmpp-go/plugins/roster\"\n)\n\nfunc main() {\n    client, err := xmpp.NewClient(\n        jid.MustParse(\"user@example.com\"),\n        \"password\",\n        xmpp.WithPlugins(disco.New(), roster.New()),\n    )\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer client.Close()\n\n    ctx := context.Background()\n    if err := client.Connect(ctx); err != nil {\n        log.Fatal(err)\n    }\n\n    msg := stanza.NewMessage(stanza.MessageChat)\n    msg.To = jid.MustParse(\"friend@example.com\")\n    msg.Body = \"Hello from xmpp-go!\"\n    _ = client.Send(ctx, msg)\n}\n```\n\n## In-Band Registration (XEP-0077)\n\n`xmpp-go` provides a standalone registration flow in `plugins/register` for account creation before authentication.\nThe helper functions automatically handle stream setup, STARTTLS upgrade, classic register fields, and data-form registration.\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \"time\"\n\n    \"github.com/meszmate/xmpp-go/plugins/register\"\n)\n\nfunc main() {\n    ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n    defer cancel()\n\n    form, err := register.FetchRegistrationForm(ctx, \"example.com\", 5222)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    fields := map[string]string{\n        \"username\": \"newuser\",\n        \"password\": \"strong-password\",\n        \"email\":    \"newuser@example.com\",\n    }\n\n    result, err := register.SubmitRegistration(\n        ctx,\n        \"example.com\",\n        5222,\n        fields,\n        form.IsDataForm,\n        form.FormType,\n    )\n    if err != nil {\n        log.Fatal(err)\n    }\n    if !result.Success {\n        log.Fatal(result.Error)\n    }\n\n    fmt.Println(\"Registered JID:\", result.JID)\n}\n```\n\nFor data-form registration, include all required fields from the fetched form in `fields` (including hidden fields and CAPTCHA answers when requested).\n\n## Feature Checklist\n\n### Core (RFC 6120/6121/7622)\n- [x] JID parsing and validation (RFC 7622)\n- [x] JID escaping (XEP-0106)\n- [x] XML stream reader/writer\n- [x] Stream error conditions\n- [x] STARTTLS negotiation\n- [x] SASL authentication\n- [x] Resource binding\n- [x] Stanza types: Message, Presence, IQ\n- [x] Stanza error conditions\n- [x] Roster management (RFC 6121)\n- [x] Presence management (RFC 6121)\n\n### Transports\n- [x] TCP transport\n- [x] WebSocket transport (RFC 7395)\n- [x] BOSH transport (XEP-0124/0206)\n\n### SASL Mechanisms\n- [x] PLAIN\n- [x] SCRAM-SHA-1 / SCRAM-SHA-1-PLUS\n- [x] SCRAM-SHA-256 / SCRAM-SHA-256-PLUS\n- [x] SCRAM-SHA-512 / SCRAM-SHA-512-PLUS\n- [x] EXTERNAL\n- [x] ANONYMOUS\n\n### Service Discovery \u0026 Capabilities\n- [x] XEP-0030: Service Discovery\n- [x] XEP-0115: Entity Capabilities\n\n### Messaging\n- [x] XEP-0085: Chat State Notifications\n- [x] XEP-0184: Message Delivery Receipts\n- [x] XEP-0280: Message Carbons\n- [x] XEP-0308: Last Message Correction\n- [x] XEP-0313: Message Archive Management\n- [x] XEP-0333: Chat Markers\n- [x] XEP-0334: Message Processing Hints\n- [x] XEP-0359: Unique/Stable Stanza IDs\n- [x] XEP-0393: Message Styling\n- [x] XEP-0424: Message Retraction\n- [x] XEP-0444: Message Reactions\n\n### Group Chat\n- [x] XEP-0045: Multi-User Chat\n- [x] XEP-0249: Direct MUC Invitations\n- [x] XEP-0369: MIX Core\n- [x] XEP-0403/0405/0406/0407: MIX extensions\n- [x] XEP-0425: Message Moderation\n\n### Stream Management\n- [x] XEP-0198: Stream Management\n\n### PubSub \u0026 Storage\n- [x] XEP-0004: Data Forms\n- [x] XEP-0060: Publish-Subscribe\n- [x] XEP-0163: Personal Eventing Protocol\n- [x] XEP-0402: PEP Native Bookmarks\n\n### User Profile\n- [x] XEP-0054: vcard-temp\n- [x] XEP-0084: User Avatar\n- [x] XEP-0092: Software Version\n- [x] XEP-0153: vCard-Based Avatars\n- [x] XEP-0292: vCard4 over XMPP\n\n### File Transfer\n- [x] XEP-0047: In-Band Bytestreams\n- [x] XEP-0065: SOCKS5 Bytestreams\n- [x] XEP-0066: Out of Band Data\n- [x] XEP-0234: Jingle File Transfer\n- [x] XEP-0363: HTTP File Upload\n- [x] XEP-0446/0447/0448: Stateless File Sharing\n\n### Encryption\n- [x] XEP-0380: Explicit Message Encryption\n- [x] XEP-0384: OMEMO Encryption (with [Signal protocol crypto module](crypto/omemo/))\n- [x] XEP-0454: OMEMO Media Sharing\n\n### Jingle (Voice/Video)\n- [x] XEP-0166: Jingle\n- [x] XEP-0167: Jingle RTP Sessions\n- [x] XEP-0176: Jingle ICE-UDP Transport\n- [x] XEP-0177: Jingle Raw UDP Transport\n- [x] XEP-0320: DTLS-SRTP in Jingle\n- [x] XEP-0353: Jingle Message Initiation\n\n### Mobile \u0026 Push\n- [x] XEP-0352: Client State Indication\n- [x] XEP-0357: Push Notifications\n\n### Server Features\n- [x] XEP-0012: Last Activity\n- [x] XEP-0050: Ad-Hoc Commands\n- [x] XEP-0059: Result Set Management\n- [x] XEP-0077: In-Band Registration\n- [x] XEP-0114: Jabber Component Protocol\n- [x] XEP-0191: Blocking Command\n- [x] XEP-0215: External Service Discovery\n- [x] XEP-0220: Server Dialback\n- [x] XEP-0288: Bidirectional Server-to-Server\n\n### Utilities\n- [x] XEP-0082: Date/Time Profiles\n- [x] XEP-0156: DNS/host-meta resolution\n- [x] XEP-0199: XMPP Ping\n- [x] XEP-0202: Entity Time\n- [x] XEP-0203: Delayed Delivery\n- [x] XEP-0231: Bits of Binary\n- [x] XEP-0297: Stanza Forwarding\n- [x] XEP-0300: Cryptographic Hash Functions\n- [x] XEP-0368: SRV records for XMPP over TLS\n\n### Modern Authentication\n- [x] XEP-0386: Bind 2\n- [x] XEP-0388: SASL2\n- [x] XEP-0440: SASL Channel-Binding Type Capability\n- [x] XEP-0484: FAST\n\n## Storage Backends\n\nxmpp-go includes a pluggable storage layer. All stateful plugins (roster, blocking, vcard, MUC, MAM, PubSub, bookmarks) automatically use the configured backend, falling back to in-memory storage when none is set.\n\n| Backend | Package | External Dependency |\n|---------|---------|-------------------|\n| Memory | `storage/memory` | None |\n| File (JSON) | `storage/file` | None |\n| SQLite | `storage/sqlite` | `github.com/mattn/go-sqlite3` |\n| PostgreSQL | `storage/postgres` | `github.com/jackc/pgx/v5` |\n| MySQL | `storage/mysql` | `github.com/go-sql-driver/mysql` |\n| MongoDB | `storage/mongodb` | `go.mongodb.org/mongo-driver/v2` |\n| Redis | `storage/redis` | `github.com/redis/go-redis/v9` |\n\n```go\nimport (\n    xmpp \"github.com/meszmate/xmpp-go\"\n    \"github.com/meszmate/xmpp-go/storage/memory\"\n)\n\nserver, _ := xmpp.NewServer(\"example.com\",\n    xmpp.WithServerStorage(memory.New()),\n    // ...\n)\n```\n\nBackends with external dependencies live in separate Go modules so the main module stays dependency-free. Install only what you need:\n\n```bash\ngo get github.com/meszmate/xmpp-go/storage/postgres\n```\n\nSee the [Storage Guide](docs/storage.md) for full details.\n\n## OMEMO Encryption\n\nxmpp-go includes a standalone Signal protocol implementation at [`crypto/omemo/`](crypto/omemo/) for OMEMO v2 (XEP-0384) end-to-end encryption. It is a separate Go module with no dependency on the main library.\n\n```bash\ngo get github.com/meszmate/xmpp-go/crypto/omemo\n```\n\nOMEMO works across both the server and client:\n\n- **Server side**: The PubSub plugin + storage backend persists device lists and bundles (public key material only). No OMEMO-specific configuration needed -- it uses standard PEP nodes.\n- **Client side**: The `crypto/omemo` package handles X3DH key agreement, Double Ratchet encryption, and AES-256-GCM. Private keys and session state are stored locally via the `omemo.Store` interface.\n\n```go\nimport \"github.com/meszmate/xmpp-go/crypto/omemo\"\n\n// Client-side crypto store (private keys, sessions, trust)\nstore := omemo.NewMemoryStore(myDeviceID)\nmanager := omemo.NewManager(store)\n\n// Generate bundle (private keys stay local, public parts go to server via PEP)\nbundle, _ := manager.GenerateBundle(25)\n\n// After fetching a contact's bundle from the server:\nmanager.ProcessBundle(addr, remoteBundleParsedFromXML)\n\n// Encrypt for recipient devices\nencMsg, _ := manager.Encrypt([]byte(\"Hello!\"), recipientAddresses...)\n\n// Decrypt incoming messages\nplaintext, _ := manager.Decrypt(senderAddr, incomingMsg)\n```\n\nSee the [OMEMO Guide](docs/omemo.md) for the full server/client architecture, step-by-step setup, and conversion between XML and crypto types.\n\n## Documentation\n\n- [Architecture Overview](docs/architecture.md)\n- [Plugin Development Guide](docs/plugins.md)\n- [Client Usage Guide](docs/client-guide.md)\n- [Server Usage Guide](docs/server-guide.md)\n- [Storage Guide](docs/storage.md)\n- [OMEMO Encryption Guide](docs/omemo.md)\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeszmate%2Fxmpp-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeszmate%2Fxmpp-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeszmate%2Fxmpp-go/lists"}