extend http-bind to support JSON syntax

I'm new to ejabberd.

I need to extend the http-bind module to support JSON(javascript) syntax.
Basically, I need ejabberd to listen to a GET request and reply with JSON syntax which is the same as returning a javascript file.

Is the right way to do it is using the ejabberd HTTP request handlers?

Do you plan to support the JSON syntax in the future?

You can ask the author.

Anonymous wrote:

Do you plan to support the JSON syntax in the future?

ejabberd's http_bind code was implemented by Stefan Strigler (the author of JWChat, MUCkl...), and was sponsored by Mabber. You can ask him.

Anonymous wrote:

I need to extend the http-bind module to support JSON(javascript) syntax.
Basically, I need ejabberd to listen to a GET request and reply with JSON syntax which is the same as returning a javascript file.

Is the right way to do it is using the ejabberd HTTP request handlers?

If you take a look at the code, mod_http_bind uses the request handler: if it receives a POST, it calls ejabberd_http_bind. If it receives a GET, it returns a simple HTML page.

If you want the same URI .../http-bind/ to serve both HTTP-Bind and your JSON stuff, then you need to extend the existing mod_http_bind file.

However, if you want that your JSON stuff is served in another URI, like .../http-json/, then you don't need to modify the existing code at all. You can simply write a new ejabberd module, with a new request handler, etc. Of course, you can copy existing code to your module if that helps you.

Syndicate content