From b2bab05c2961757f78332168fde255156b744c8c Mon Sep 17 00:00:00 2001 From: Peter Fabian Mitchell Date: Sun, 7 Dec 2014 16:56:47 +0100 Subject: [PATCH] HTTP: Add 'http.publish_port' setting to the HTTP module This change adds a 'http.publish_port' setting to the HTTP module to configure the port which HTTP clients should use when communicating with the node. This is useful when running on a bridged network interface or when running behind a proxy or firewall. Closes #8807 Closes #8137 --- docs/reference/modules/http.asciidoc | 5 ++ .../http/netty/NettyHttpServerTransport.java | 8 ++- .../http/netty/HttpPublishPortTests.java | 60 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/test/java/org/elasticsearch/http/netty/HttpPublishPortTests.java diff --git a/docs/reference/modules/http.asciidoc b/docs/reference/modules/http.asciidoc index 0ae864fa5e2..89410d46aea 100644 --- a/docs/reference/modules/http.asciidoc +++ b/docs/reference/modules/http.asciidoc @@ -25,6 +25,11 @@ The following are the settings that can be configured for HTTP: |Setting |Description |`http.port` |A bind port range. Defaults to `9200-9300`. +|`http.publish_port` |The port that HTTP clients should use when +communicating with this node. Useful when a cluster node is behind a +proxy or firewall and the `http.port` is not directly addressable +from the outside. Defaults to the actual port assigned via `http.port`. + |`http.bind_host` |The host address to bind the HTTP service to. Defaults to `http.host` (if set) or `network.bind_host`. |`http.publish_host` |The host address to publish for HTTP clients to connect to. Defaults to `http.host` (if set) or `network.publish_host`. diff --git a/src/main/java/org/elasticsearch/http/netty/NettyHttpServerTransport.java b/src/main/java/org/elasticsearch/http/netty/NettyHttpServerTransport.java index 62baa59a72b..9195754541f 100644 --- a/src/main/java/org/elasticsearch/http/netty/NettyHttpServerTransport.java +++ b/src/main/java/org/elasticsearch/http/netty/NettyHttpServerTransport.java @@ -109,6 +109,8 @@ public class NettyHttpServerTransport extends AbstractLifecycleComponent