aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-15 17:52:11 +0100
committerKim Alvefur <zash@zash.se>2018-03-15 17:52:11 +0100
commit2bd1debc3c5db69844ed00b42074543e93757d22 (patch)
tree11907bb7fcd19300c62dc4708f7992bc679f7d80 /plugins
parent4cdc813fed0cd2dfa6c3c9954650d581b9b90ee3 (diff)
downloadprosody-2bd1debc3c5db69844ed00b42074543e93757d22.tar.gz
prosody-2bd1debc3c5db69844ed00b42074543e93757d22.zip
mod_websocket: Transfer IP address derived by mod_http
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_websocket.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua
index ed73962d..4f43cb7b 100644
--- a/plugins/mod_websocket.lua
+++ b/plugins/mod_websocket.lua
@@ -256,6 +256,10 @@ function handle_request(event)
local session = sessions[conn];
+ -- Use upstream IP if a HTTP proxy was used
+ -- See mod_http and #540
+ session.ip = request.ip;
+
session.secure = consider_websocket_secure or session.secure;
session.open_stream = session_open_stream;