KestrunHost.ConfigureListener method (1 of 3)

Configures a listener for the Kestrun host with the specified port and connection logging option.

public void ConfigureListener(int port, bool useConnectionLogging = false)
parameter description
port The port number to listen on.
useConnectionLogging Specifies whether to enable connection logging.

See Also


KestrunHost.ConfigureListener method (2 of 3)

Configures a listener for the Kestrun host with the specified port, optional IP address, and connection logging.

public void ConfigureListener(int port, IPAddress? ipAddress = null, 
    bool useConnectionLogging = false)
parameter description
port The port number to listen on.
ipAddress The IP address to bind to. If null, binds to any address.
useConnectionLogging Specifies whether to enable connection logging.

See Also


KestrunHost.ConfigureListener method (3 of 3)

Configures a listener for the Kestrun host with the specified port, optional IP address, certificate, protocols, and connection logging.

public KestrunHost ConfigureListener(int port, IPAddress? ipAddress = null, 
    X509Certificate2? x509Certificate = null, HttpProtocols protocols = HttpProtocols.Http1, 
    bool useConnectionLogging = false)
parameter description
port The port number to listen on.
ipAddress The IP address to bind to. If null, binds to any address.
x509Certificate The X509 certificate for HTTPS. If null, HTTPS is not used.
protocols The HTTP protocols to use.
useConnectionLogging Specifies whether to enable connection logging.

Return Value

The current KestrunHost instance.

See Also