Open Source API Gateway

proxy

Version

Configuration for an outbound HTTP proxy used by the HTTP client.

Defines the proxy endpoint, optional authentication, and TLS settings. When configured, all outgoing requests are routed through the proxy.

This element is typically used as a child of httpClientConfig.

Example Configuration

configuration:
httpClientConfig:
proxy:
host: localhost
port: 3128
authentication: true
username: alice
password: secret
configuration:
   httpClientConfig:
     proxy:
       host: localhost
       port: 3128
       authentication: true
       username: alice
       password: secret

Syntax

proxy:
'$ref': <string>
authentication: <boolean>
host: <string>
password: <string>
port: <int>
ssl: {}
username: <string>
proxy:
  '$ref': <string>
  authentication: <boolean>
  host: <string>
  password: <string>
  port: <int>
  ssl: {}
  username: <string>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
authenticationfalsefalseWhether to send a Basic Authentication header with proxy requests. If set to true, <username> and <password> must be provided. For a plain HTTP target, the credentials are sent in the Proxy-Authorization header of the request and replace a Proxy-Authorization header sent by the client. For an HTTPS target, they are sent only with the CONNECT request that opens the tunnel, and the request inside the tunnel carries the client's original header, if any. After a plain HTTP attempt through the proxy, the client's original header is restored, so a retry through an HTTPS tunnel or without the proxy does not carry the credentials, and after the call the request holds the client's original header. Whether a plain HTTP proxy removes the Proxy-Authorization header before forwarding the request is up to the proxy.-
hostfalse-The hostname or IP address of the proxy server. Required for proxy usage.proxy.example.com
passwordfalse(not set)Password for authenticating with the proxy server. Only used when authentication="true".secret
portfalse0TCP port on which the proxy server is listening.3128
usernamefalse(not set)Username for authenticating with the proxy server. Only used when authentication="true".user

Child Structure

ElementCardinalityDescription
ssl0..1Configures a TLS context: the identity (key and certificate) presented to the peer, the certificates trusted from it, and handshake parameters such as protocol, ciphers, and client-certificate policy. Attach it to a serviceProxy/api to terminate inbound TLS, or to a target to make an outbound connection over TLS; most attributes and child elements apply to both directions, but a few - such as clientAuth and useAsDefault - only take effect on an inbound context. See tutorials/ssl-tls/10-TLS-Termination.yaml for inbound termination and tutorials/ssl-tls/20-Central-SSL-Config.yaml for sharing one ssl across several APIs via $ref.

Can be used in