Mercurial > prosody-modules
comparison mod_http_rest/README.md @ 5975:fe081789f7b5
All community modules: Unify file extention of Markdown files to .md
| author | Menel <menel@snikket.de> |
|---|---|
| date | Tue, 22 Oct 2024 10:26:01 +0200 |
| parents | mod_http_rest/README.markdown@79432b859d21 |
| children |
comparison
equal
deleted
inserted
replaced
| 5974:5a65a632d5b9 | 5975:fe081789f7b5 |
|---|---|
| 1 --- | |
| 2 labels: | |
| 3 - 'Stage-Alpha' | |
| 4 summary: Send XMPP stanzas via REST/HTTP | |
| 5 ... | |
| 6 | |
| 7 This module provides a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)ful | |
| 8 method for sending XMPP stanzas. | |
| 9 | |
| 10 This enables you to send stanzas by making HTTP requests to `http://${prosody-url}/rest`. | |
| 11 | |
| 12 **DANGER/ACHTUNG!: This module does NOT enforce any authentication or user-checking. | |
| 13 This means that by default stanzas can be sent *anyone* on behalf of *any* user.** | |
| 14 | |
| 15 You should enable [mod_http_authentication](https://modules.prosody.im/mod_http_authentication.html), | |
| 16 to require authentication for calls made to this module, or alternatively, you | |
| 17 could use a reverse proxy like Nginx. | |
| 18 | |
| 19 # To enable this module | |
| 20 | |
| 21 Add `"http_rest"` to `modules_enabled`, either globally or for a particular virtual | |
| 22 host. | |
| 23 | |
| 24 # How to test: | |
| 25 | |
| 26 You can use curl to make the HTTP request to Prosody, to test whether this | |
| 27 module is working properly: | |
| 28 | |
| 29 curl -k http://localhost:5280/rest -u username:password -H "Content-Type: text/xml" -d '<iq to="pubsub.localhost" type="set" id="4dd1a1e3-ef91-4017-a5aa-eaba0a82eb94-1" from="user@localhost"><pubsub xmlns="http://jabber.org/protocol/pubsub"><publish node="Test mod_rest.lua"><item>Hello World!</item></publish></pubsub></iq>' |
