Mercurial > prosody-modules
annotate mod_tcpproxy/web/demo.html @ 5173:460f78654864
mod_muc_rtbl: also filter messages
This was a bit tricky because we don't want to run the JIDs
through SHA256 on each message. Took a while to come up with this
simple plan of just caching the SHA256 of the JIDs on the
occupants.
This will leave some dirt in the occupants after unloading the
module, but that should be ok; once they cycle the room, the
hashes will be gone.
This is direly needed, otherwise, there is a tight race between
the moderation activities and the actors joining the room.
author | Jonas Schäfer <jonas@wielicki.name> |
---|---|
date | Tue, 21 Feb 2023 21:37:27 +0100 |
parents | 7dbde05b48a9 |
children |
rev | line source |
---|---|
148
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 <html> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 <head> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 <script type="text/javascript" src="xmpp.io.js"></script> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 <script type="text/javascript" src="strophe.js"></script> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 <script type="text/javascript" src="src/jquery-1.4.2.min.js"></script> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 <script type="text/javascript"> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 function handle_connection_status(status, err) |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 { |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 console.log("XMPP status: "+Strophe.Status.CONNECTED); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 if(status == Strophe.Status.CONNECTED) |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 { |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 var conn = new XMPPIO(xmppconn, "tcp.localhost"); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 conn.addListener("connect", function () { |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 var req = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n"; |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 console.log("Sending request: "+req); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 conn.write(req); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 }); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 conn.addListener("data", function (data) |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 { |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 $("<div/>").text(data).appendTo("body"); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 }); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 console.log("Connecting to example.com:80..."); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 conn.connect("example.com", 80); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 } |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 } |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 var xmppconn = new Strophe.Connection("/http-bind"); |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 xmppconn.connect("anon.localhost", null, handle_connection_status, 50); |
1343
7dbde05b48a9
all the things: Remove trailing whitespace
Florian Zeitz <florob@babelmonkeys.de>
parents:
148
diff
changeset
|
29 |
148
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 </script> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 </head> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 <body> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 </body> |
f2f9b965d1ad
mod_tcpproxy: Add web/ folder containing demo JS client
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 </html> |