{"id":21658368,"url":"https://github.com/FluuxIO/go-xmpp","last_synced_at":"2025-07-17T21:30:51.804Z","repository":{"id":3346465,"uuid":"48737311","full_name":"FluuxIO/go-xmpp","owner":"FluuxIO","description":"Native Go XMPP library","archived":false,"fork":false,"pushed_at":"2024-05-16T15:41:31.000Z","size":692,"stargazers_count":314,"open_issues_count":41,"forks_count":63,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-29T15:25:39.750Z","etag":null,"topics":["chat","go","golang","iot","xmpp","xmpp-library"],"latest_commit_sha":null,"homepage":"https://www.process-one.net/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FluuxIO.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2015-12-29T08:35:46.000Z","updated_at":"2024-10-29T06:02:33.000Z","dependencies_parsed_at":"2024-05-16T15:55:04.304Z","dependency_job_id":"a3b7ada0-0a66-4717-b3f9-505af7d28c5b","html_url":"https://github.com/FluuxIO/go-xmpp","commit_stats":{"total_commits":431,"total_committers":13,"mean_commits":33.15384615384615,"dds":"0.28306264501160094","last_synced_commit":"7186c058fd8eb4985efa52ed00ddbef30371c211"},"previous_names":["processone/gox"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Fgo-xmpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Fgo-xmpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Fgo-xmpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Fgo-xmpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluuxIO","download_url":"https://codeload.github.com/FluuxIO/go-xmpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225958007,"owners_count":17551331,"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":["chat","go","golang","iot","xmpp","xmpp-library"],"created_at":"2024-11-25T09:29:10.857Z","updated_at":"2024-11-25T09:29:16.413Z","avatar_url":"https://github.com/FluuxIO.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Fluux XMPP\n\n[![GoDoc](https://godoc.org/gosrc.io/xmpp?status.svg)](https://godoc.org/gosrc.io/xmpp) [![GoReportCard](https://goreportcard.com/badge/gosrc.io/xmpp)](https://goreportcard.com/report/fluux.io/xmpp) [![Coverage Status](https://coveralls.io/repos/github/FluuxIO/go-xmpp/badge.svg?branch=master)](https://coveralls.io/github/FluuxIO/go-xmpp?branch=master)\n\nFluux XMPP is a Go XMPP library, focusing on simplicity, simple automation, and IoT.\n\nThe goal is to make simple to write simple XMPP clients and components:\n\n- For automation (like for example monitoring of an XMPP service),\n- For building connected \"things\" by plugging them on an XMPP server,\n- For writing simple chatbot to control a service or a thing,\n- For writing XMPP servers components.\n\nThe library is designed to have minimal dependencies. Currently it requires at least Go 1.13.\n\n## Configuration and connection\n\n### Allowing Insecure TLS connection during development\n\nIt is not recommended to disable the check for domain name and certificate chain. Doing so would open your client\nto man-in-the-middle attacks.\n\nHowever, in development, XMPP servers often use self-signed certificates. In that situation, it is better to add the\nroot CA that signed the certificate to your trusted list of root CA. It avoids changing the code and limit the risk\nof shipping an insecure client to production.\n\nThat said, if you really want to allow your client to trust any TLS certificate, you can customize Go standard \n`tls.Config` and set it in Config struct.\n\nHere is an example code to configure a client to allow connecting to a server with self-signed certificate. Note the \n`InsecureSkipVerify` option. When using this `tls.Config` option, all the checks on the certificate are skipped.\n\n```go\nconfig := xmpp.Config{\n\tAddress:      \"localhost:5222\",\n\tJid:          \"test@localhost\",\n\tCredential:   xmpp.Password(\"Test\"),\n\tTLSConfig:    tls.Config{InsecureSkipVerify: true},\n}\n```\n\n## Supported specifications\n\n### Clients\n\n- [RFC 6120: XMPP Core](https://xmpp.org/rfcs/rfc6120.html)\n- [RFC 6121: XMPP Instant Messaging and Presence](https://xmpp.org/rfcs/rfc6121.html)\n\n### Components\n\n  - [XEP-0114: Jabber Component Protocol](https://xmpp.org/extensions/xep-0114.html)\n  - [XEP-0355: Namespace Delegation](https://xmpp.org/extensions/xep-0355.html)\n  - [XEP-0356: Privileged Entity](https://xmpp.org/extensions/xep-0356.html)\n\n### Extensions \n  - [XEP-0060: Publish-Subscribe](https://xmpp.org/extensions/xep-0060.html)  \n    Note : \"6.5.4 Returning Some Items\" requires support for [XEP-0059: Result Set Management](https://xmpp.org/extensions/xep-0059.html), \n    and is therefore not supported yet. \n  - [XEP-0004: Data Forms](https://xmpp.org/extensions/xep-0004.html)\n  - [XEP-0050: Ad-Hoc Commands](https://xmpp.org/extensions/xep-0050.html)\n\n## Package overview\n\n### Stanza subpackage\n\nXMPP stanzas are basic and extensible XML elements. Stanzas (or sometimes special stanzas called 'nonzas') are used to \nleverage the XMPP protocol features. During a session, a client (or a component) and a server will be exchanging stanzas\nback and forth.\n\nAt a low-level, stanzas are XML fragments. However, Fluux XMPP library provides the building blocks to interact with\nstanzas at a high-level, providing a Go-friendly API.\n\nThe `stanza` subpackage provides support for XMPP stream parsing, marshalling and unmarshalling of XMPP stanza. It is a\nbridge between high-level Go structure and low-level XMPP protocol.\n\nParsing, marshalling and unmarshalling is automatically handled by Fluux XMPP client library. As a developer, you will\ngenerally manipulates only the high-level structs provided by the stanza package.\n\nThe XMPP protocol, as the name implies is extensible. If your application is using custom stanza extensions, you can\nimplement your own extensions directly in your own application.\n\nTo learn more about the stanza package, you can read more in the\n[stanza package documentation](https://github.com/FluuxIO/go-xmpp/blob/master/stanza/README.md).\n\n### Router\n\nTODO\n\n### Getting IQ response from server\n\nTODO\n\n## Examples\n\nWe have several [examples](https://github.com/FluuxIO/go-xmpp/tree/master/_examples) to help you get started using\nFluux XMPP library.\n\nHere is the demo \"echo\" client:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"gosrc.io/xmpp\"\n\t\"gosrc.io/xmpp/stanza\"\n)\n\nfunc main() {\n\tconfig := xmpp.Config{\n\t\tTransportConfiguration: xmpp.TransportConfiguration{\n\t\t\tAddress: \"localhost:5222\",\n\t\t},\n\t\tJid:          \"test@localhost\",\n\t\tCredential:   xmpp.Password(\"test\"),\n\t\tStreamLogger: os.Stdout,\n\t\tInsecure:     true,\n\t\t// TLSConfig: tls.Config{InsecureSkipVerify: true},\n\t}\n\n\trouter := xmpp.NewRouter()\n\trouter.HandleFunc(\"message\", handleMessage)\n\n\tclient, err := xmpp.NewClient(config, router, errorHandler)\n\tif err != nil {\n\t\tlog.Fatalf(\"%+v\", err)\n\t}\n\n\t// If you pass the client to a connection manager, it will handle the reconnect policy\n\t// for you automatically.\n\tcm := xmpp.NewStreamManager(client, nil)\n\tlog.Fatal(cm.Run())\n}\n\nfunc handleMessage(s xmpp.Sender, p stanza.Packet) {\n\tmsg, ok := p.(stanza.Message)\n\tif !ok {\n\t\t_, _ = fmt.Fprintf(os.Stdout, \"Ignoring packet: %T\\n\", p)\n\t\treturn\n\t}\n\n\t_, _ = fmt.Fprintf(os.Stdout, \"Body = %s - from = %s\\n\", msg.Body, msg.From)\n\treply := stanza.Message{Attrs: stanza.Attrs{To: msg.From}, Body: msg.Body}\n\t_ = s.Send(reply)\n}\n\nfunc errorHandler(err error) {\n\tfmt.Println(err.Error())\n}\n\n```\n\n## Reference documentation\n\nThe code documentation is available on GoDoc: [gosrc.io/xmpp](https://godoc.org/gosrc.io/xmpp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFluuxIO%2Fgo-xmpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFluuxIO%2Fgo-xmpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFluuxIO%2Fgo-xmpp/lists"}