GithubHelp home page GithubHelp logo

ph-f / mod_offline_http_post Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nimrodda/mod_offline_http_post

8.0 4.0 12.0 30 KB

Ejabberd 17.01 module to send offline user's message via POST request to target URL

License: Other

Erlang 90.95% Ruby 9.05%

mod_offline_http_post's Introduction

Ejabberd 18.06+ module to send offline user's message via POST request to target URL. This module can call an api to send e.g. a push message. The request body is in application/x-www-form-urlencoded format. See the example below.

V17.01 Forked from Nimrodda/mod_offline_http_post ejabberd 16.08

V17.04 updated and tested in 17.04, I assume it works in 17.03 also.

V19.02 updated and tested in 19.02, I assume it works in 18.06, 18.09 and 18.12 also.

Installation

  1. cd /opt/ejabberd-19.02/.ejabberd-module/sources/
  2. git clone https://github.com/PH-F/mod_offline_http_post.git;
  3. bash /opt/ejabberd-19.02/.ejabberd-module/bin/ejabberdctl module-install mod_offline_http_post
  4. /etc/init.d/ejabberd restart;

That's it. The module is now installed.

Configuration

Add the following to ejabberd configuration under modules:

mod_offline_http_post:
    auth_token: "secret"
    post_url: "http://example.com/notify"
    confidential: true
  • auth_token - user defined, hard coded token that will be sent as part of the request's body. Use this token on the target server to validate that the request arrived from a trusted source.
  • post_url - the server's endpoint url
  • confidential - boolean parameter; if true, do not send the message body in post data. if false (default), send the message body.

Example of the outgoing request:

array(5) {
  ["to"]=>
  string(11) "testuser"
  ["from"]=>
  string(7) "patrick"
  ["vhost"]=>
  string(16) "server.myserver.nl"
  ["body"]=>
  string(7) "This is a testmessage"
  ["messageId"]=>
  string(13) "purple3838f2f"
}

mod_offline_http_post's People

Contributors

ahmusa avatar badlop avatar ph-f avatar raelmax avatar spyy avatar thomaschiroux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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