PySide6.QtHttpServer.QHttpServerConfiguration

class QHttpServerConfiguration

The QHttpServerConfiguration class controls server parameters.

Added in version 6.9.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()

Default constructs a QHttpServerConfiguration object.

Such a configuration has the following values:

  • Rate limit is disabled

__init__(other)
Parameters:

otherQHttpServerConfiguration

Copy-constructs this QHttpServerConfiguration .

keepAliveTimeout()
Return type:

std::chrono::seconds

Returns the keep-alive timeout used by QHttpServer .

__ne__(rhs)
Parameters:

rhsQHttpServerConfiguration

Return type:

bool

Returns true if lhs and rhs do not have the same set of configuration parameters.

__eq__(rhs)
Parameters:

rhsQHttpServerConfiguration

Return type:

bool

Returns true if lhs and rhs have the same set of configuration parameters.

rateLimitPerSecond()
Return type:

int

Returns maximum number of incoming requests per second per IP accepted by the server.

setKeepAliveTimeout(timeout)
Parameters:

timeoutstd::chrono::seconds

Sets timeout as keep-alive timeout for QHttpServer .

The keep-alive timeout determines how long an idle connection is kept open before being closed. By default, the timeout is set to 15 seconds.

setRateLimitPerSecond(maxRequests)
Parameters:

maxRequests – int

Sets maxRequests as the maximum number of incoming requests per second per IP that will be accepted by QHttpServer . If the limit is exceeded, QHttpServer will respond with TooManyRequests .

swap(other)
Parameters:

otherQHttpServerConfiguration

Swaps this configuration with other. This operation is very fast and never fails.