Mercurial > prosody-wiki
comparison mod_register_json.wiki @ 184:ad1b7e71c32e
Created wiki page through web user interface.
author | maranda3985@gmail.com |
---|---|
date | Tue, 12 Apr 2011 23:34:57 +0000 |
parents | |
children | 9aab3736b3ca |
comparison
equal
deleted
inserted
replaced
183:99ccedc61bca | 184:ad1b7e71c32e |
---|---|
1 #summary mini JSON registration servlet. | |
2 #labels Stage-Alpha | |
3 | |
4 = Introduction = | |
5 | |
6 This module let's you activate a httpserver interface to handle data from webforms with POST and JSON. | |
7 | |
8 = Details = | |
9 | |
10 It will accept the following format: | |
11 | |
12 {{{ | |
13 POST /your_register_base_url HTTP/1.0 | |
14 Host: yourserveraddress.com:yourchoosenport | |
15 Authorization: Basic base64authstring | |
16 Content-Type: application/json | |
17 | |
18 {"username":"usernameofchoice","password":"theuserpassword","host":"yourserverorvhostaddress","ip":"theremoteaddroftheuser"} | |
19 }}} | |
20 | |
21 It will require a server admin (of the given host) to provide valid credentials to submit data via Basic HTTP auth first. | |
22 | |
23 The ip field is at the moment is required to be present even if unset (""), you will require to set it using the webserver's REMOTE_ADDR global (or similar) to pass the client's ip address should you want to employ throttling/blacklisting/whitelisting of requests. | |
24 | |
25 = Usage = | |
26 | |
27 Copy the module file into your prosody modules directory. | |
28 Load the module in your configuration file's global section (Host "*"), that would suffice to run it. | |
29 | |
30 Optional configuration directives: | |
31 {{{ | |
32 reg_servlet_realm = "Your Realm Name of choice" -- Modifies the name of the authentication realm. | |
33 reg_servlet_ttime = minutes -- Specifies the time (in minutes) between each request coming from the same remote address. | |
34 reg_servlet_bl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be blacklisted and won't be able to register. | |
35 reg_servlet_wl = { "1.2.3.4", "4.3.2.1" } -- The ip addresses in this list will be ignored by the throttling. | |
36 }}} | |
37 | |
38 = Compatibility = | |
39 | |
40 Trunk - works. | |
41 0.8 - untested. | |
42 0.7 - untested. |