summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-06-13 07:30:32 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-06-13 07:30:32 +0200
commit424bff4d6c7a99d3c162df8c9ad69e6f6aad2715 (patch)
tree7c33413a48969e91689a8e614a9edfc6038db583
parent7a769648e87235d2d2197820c448f71d47e1865a (diff)
parentfc8f7b49dd56047280085d478665d42f32213c80 (diff)
downloadweechat-424bff4d6c7a99d3c162df8c9ad69e6f6aad2715.zip
Merge remote-tracking branch 'origin/pr/440'
-rw-r--r--ChangeLog.asciidoc1
-rw-r--r--src/plugins/relay/relay-client.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index ac96582a1..9c41f7f13 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -19,6 +19,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
=== New features
+* relay: print value of HTTP Header X-Real-IP for websocket connections
* core: add signal "signal_sighup"
=== Bugs fixed
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c
index 66f0b3e29..1fa56fa5b 100644
--- a/src/plugins/relay/relay-client.c
+++ b/src/plugins/relay/relay-client.c
@@ -379,6 +379,17 @@ relay_client_recv_text (struct t_relay_client *client, const char *data)
relay_client_set_status (client, RELAY_STATUS_DISCONNECTED);
}
+ if (weechat_hashtable_get (client->http_headers, "X-Real-IP")) {
+ weechat_printf_tags (NULL, "relay_client",
+ _("%s: websocket client %s%s%s has real IP \"%s\""),
+ RELAY_PLUGIN_NAME,
+ RELAY_COLOR_CHAT_CLIENT,
+ client->desc,
+ RELAY_COLOR_CHAT,
+ weechat_hashtable_get (client->http_headers, "X-Real-IP")
+ );
+ }
+
/* remove HTTP headers */
weechat_hashtable_free (client->http_headers);
client->http_headers = NULL;