.. _envoy_v3_api_file_envoy/config/core/v3/socket_option.proto: Socket Option (proto) ====================== .. _envoy_v3_api_msg_config.core.v3.SocketOption: config.core.v3.SocketOption --------------------------- :repo:`[config.core.v3.SocketOption proto] ` Generic socket option message. This would be used to set socket options that might not exist in upstream kernels or precompiled Envoy binaries. For example: .. code-block:: json { "description": "support tcp keep alive", "state": 0, "level": 1, "name": 9, "int_value": 1, } 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux. With the above configuration, `TCP Keep-Alives `_ can be enabled in socket with Linux, which can be used in :ref:`listener's` or :ref:`admin's ` socket_options etc. It should be noted that the name or level may have different values on different platforms. .. code-block:: json :force: { "description": ..., "level": ..., "name": ..., "int_value": ..., "buf_value": ..., "state": ... } .. _envoy_v3_api_field_config.core.v3.SocketOption.description: description (`string `_) An optional name to give this socket option for debugging, etc. Uniqueness is not required and no special meaning is assumed. .. _envoy_v3_api_field_config.core.v3.SocketOption.level: level (`int64 `_) Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP .. _envoy_v3_api_field_config.core.v3.SocketOption.name: name (`int64 `_) The numeric name as passed to setsockopt .. _envoy_v3_api_field_config.core.v3.SocketOption.int_value: int_value (`int64 `_) Because many sockopts take an int value. Precisely one of :ref:`int_value `, :ref:`buf_value ` must be set. .. _envoy_v3_api_field_config.core.v3.SocketOption.buf_value: buf_value (`bytes `_) Otherwise it's a byte buffer. Precisely one of :ref:`int_value `, :ref:`buf_value ` must be set. .. _envoy_v3_api_field_config.core.v3.SocketOption.state: state (:ref:`config.core.v3.SocketOption.SocketState `) The state in which the option will be applied. When used in BindConfig STATE_PREBIND is currently the only valid value. .. _envoy_v3_api_enum_config.core.v3.SocketOption.SocketState: Enum config.core.v3.SocketOption.SocketState -------------------------------------------- :repo:`[config.core.v3.SocketOption.SocketState proto] ` .. _envoy_v3_api_enum_value_config.core.v3.SocketOption.SocketState.STATE_PREBIND: STATE_PREBIND *(DEFAULT)* ⁣Socket options are applied after socket creation but before binding the socket to a port .. _envoy_v3_api_enum_value_config.core.v3.SocketOption.SocketState.STATE_BOUND: STATE_BOUND ⁣Socket options are applied after binding the socket to a port but before calling listen() .. _envoy_v3_api_enum_value_config.core.v3.SocketOption.SocketState.STATE_LISTENING: STATE_LISTENING ⁣Socket options are applied after calling listen()