Http Listener is a listener specifically designed to receive HTTP requests. It can set the address and port for HTTP listening. It can be introduced through the following configuration.
static_resources:
listeners:
- name: "net/http"
protocol_type: "HTTP" # Indicates the HTTP Listener is being introduced
address:
socket_address:
address: "0.0.0.0" # Address
port: 8883 # Port
The specific implementation of the Http Listener can be referred to in pkg/listener/http
.
For cases related to HTTP Listener, you can refer to:
Currently, the HTTPS protocol is also supported. You can change protocol_type
to HTTPS
and add domains
and certs_dir
to specify the domain and certificate file directory.
listeners:
- name: "net/http"
protocol_type: "HTTPS"
address:
socket_address:
domains:
- "sample.domain.com"
- "sample.domain-1.com"
- "sample.domain-2.com"
certs_dir: $PROJECT_DIR/cert
For specific cases, you can check Case