4. Transports and Clients

httpClientConfig

Configuration container for Membrane's HTTP client. Allows defining proxy, connection, authentication, TLS, and retry behavior. Can be used as a reusable bean and referenced via . Most of its sub-elements are optional.

YAML:

httpClientConfig:
   adjustHostHeader: true
   connection:
     timeout: 10000
   proxy:
     host: proxy.example.com
     port: 3128
   authentication:
     type: basic
     user: user
     password: pass
   ssl:
     keystoreLocation: classpath:client.jks
     keystorePassword: secret
 

Can be used in:

balancerHealthMonitor, httpClient, acme, registration and router

Sample

<httpClientConfig maxRetries="5" adjustHostHeader="true">
    <connection timeout="10000"/>
    <proxy host="proxy.example.com" port="3128"/>
    <authentication type="basic" user="user" password="pass"/>
    <ssl keystoreLocation="classpath:client.jks" keystorePassword="secret"/>
</httpClientConfig>

Attributes

NameRequiredDefaultDescriptionExamples
useExperimentalHttp2 false false
Enables experimental support for HTTP/2. When true, HTTP/2 connections are attempted when possible.
-
adjustHostHeader false true
Whether to automatically rewrite the Host header to match the target address. This is useful when routing requests to internal systems where the Host header must match the backend.
-

Child Elements

ElementsDescriptionCardinality
retries Advanced configuration for retry behavior. Allows detailed retry logic beyond the simple maxRetries setting. 0..1
connection Configuration for low-level socket behavior of Membrane's HTTP client. This includes timeouts and local address binding for outbound connections. Typically used as a child of <httpClientConfig>. XML Example: <connection keepAliveTimeout="30000" timeout="10000" soTimeout="5000" localAddr="192.168.1.100"/> YAML (experimental):
connection:
                keepAliveTimeout: 30000
                timeout: 10000
                soTimeout: 5000
                localAddr: "192.168.1.100"
0..1
proxy Configuration for an outbound HTTP proxy. Defines the address, optional authentication credentials, and TLS configuration for connecting to a proxy. Can be used as a child element in <httpClientConfig> to route client connections through a proxy server. XML Example: <proxy host="proxy.example.com" port="3128" authentication="true" username="user" password="secret"> <ssl keystoreLocation="classpath:proxy-client.jks" keystorePassword="changeit"/> </proxy> YAML (experimental): proxy: host: proxy.example.com port: 3128 authentication: true username: user password: secret ssl: keystoreLocation: classpath:proxy-client.jks keystorePassword: changeit 0..1
authentication Configuration for basic HTTP authentication. This element can be used to configure credentials for outbound requests requiring HTTP Basic Auth. Typically used within <httpClientConfig>. XML Example: <authentication username="user" password="secret"/> YAML (experimental): authentication: username: user password: secret 0..1
ssl Configures inbound or outbound SSL connections. 0..1