Mercurial > prosody-hg
comparison plugins/mod_proxy65.lua @ 9642:e31053344231
mod_proxy65: Return an error if no port is open (fixes #1240)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 25 Nov 2018 13:14:05 +0100 |
| parents | e6968e47826d |
| children | bb8486491b48 |
comparison
equal
deleted
inserted
replaced
| 9544:cbd3b9d4c60b | 9642:e31053344231 |
|---|---|
| 119 module:log("warn", "Denying use of proxy for %s", tostring(stanza.attr.from)); | 119 module:log("warn", "Denying use of proxy for %s", tostring(stanza.attr.from)); |
| 120 origin.send(st.error_reply(stanza, "auth", "forbidden")); | 120 origin.send(st.error_reply(stanza, "auth", "forbidden")); |
| 121 return true; | 121 return true; |
| 122 end | 122 end |
| 123 | 123 |
| 124 if not proxy_port then | |
| 125 module:log("warn", "Not listening on any port"); | |
| 126 origin.send(st.error_reply(stanza, "wait", "item-not-found", "Not listening on any port")); | |
| 127 return true; | |
| 128 end | |
| 129 | |
| 124 local sid = stanza.tags[1].attr.sid; | 130 local sid = stanza.tags[1].attr.sid; |
| 125 origin.send(st.reply(stanza):tag("query", {xmlns="http://jabber.org/protocol/bytestreams", sid=sid}) | 131 origin.send(st.reply(stanza):tag("query", {xmlns="http://jabber.org/protocol/bytestreams", sid=sid}) |
| 126 :tag("streamhost", {jid=host, host=proxy_address, port=proxy_port})); | 132 :tag("streamhost", {jid=host, host=proxy_address, port=proxy_port})); |
| 127 return true; | 133 return true; |
| 128 end); | 134 end); |
