# listener

Envoy配置在单个进程中支持任意数量的listener。通常，无论配置了多少listener，我们都建议每台计算机运行一个Envoy。这样可以简化操作并提供单一统计数据。Envoy支持TCP和UDPlistener。

## TCP协议

每个listener都独立配置有一些数量filter chains，其中根据其匹配条件选择单个chain 。单个filter chains由一个或多个网络级别（L3 / L4） filter组成。在listener上收到新连接时，将选择适当的filter chain，并实例化已配置的连接本地filter堆栈，并开始处理后续事件。通用listener体系结构用于执行Envoy所使用的绝大多数不同代理任务（例如，速率限制，TLS客户端身份验证，HTTP连接管理，MongoDB嗅探，原始TCP代理）等）。

listener还可以选择配置一些listener filter。这些 filter在网络级 filter之前进行处理，并且有机会操纵连接元数据，通常会影响以后的 filter或群集如何处理连接。

listener也可以通过listener发现服务（LDS）动态获取。

listener配置。

## UDP协议

Envoy还支持UDPlistener，尤其是UDPlistener filter。UDP listener filter每个工作程序实例化一次，并且对于该工作程序是全局的。每个listener filter都会处理工作人员在端口上侦听的每个UDP数据报。实际上，使用SO\_REUSEPORT内核选项配置UDPlistener，这将使内核将每个UDP 4元组一致地散列到同一工作程序。如果需要，这可以使UDPlistener filter面向“会话”。UDP代理listener filter是此功能的内置示例。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rocdu.gitbook.io/deep-understanding-of-istio/9/1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
