QHttpServerConfiguration Class
QHttpServerConfiguration 클래스는 서버 매개 변수를 제어합니다. 더 보기...
Header: | #include <QHttpServerConfiguration> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
qmake: | QT += httpserver |
이후: | Qt 6.9 |
공용 함수
QHttpServerConfiguration() | |
QHttpServerConfiguration(const QHttpServerConfiguration &other) | |
QHttpServerConfiguration(QHttpServerConfiguration &&other) | |
~QHttpServerConfiguration() | |
(since 6.10) QSpan<const std::pair<QHostAddress, int>> | blacklist() const |
(since 6.10) std::chrono::seconds | keepAliveTimeout() const |
quint32 | rateLimitPerSecond() const |
(since 6.10) void | setBlacklist(QSpan<const std::pair<QHostAddress, int>> subnetList) |
(since 6.10) void | setKeepAliveTimeout(std::chrono::seconds timeout) |
void | setRateLimitPerSecond(quint32 maxRequests) |
(since 6.10) void | setWhitelist(QSpan<const std::pair<QHostAddress, int>> subnetList) |
void | swap(QHttpServerConfiguration &other) |
(since 6.10) QSpan<const std::pair<QHostAddress, int>> | whitelist() const |
QHttpServerConfiguration & | operator=(QHttpServerConfiguration &&other) |
QHttpServerConfiguration & | operator=(const QHttpServerConfiguration &other) |
관련 비회원
bool | operator!=(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs) |
bool | operator==(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs) |
멤버 함수 문서
QHttpServerConfiguration::QHttpServerConfiguration()
기본값은 QHttpServerConfiguration 객체를 생성합니다.
이러한 구성에는 다음과 같은 값이 있습니다:
- 속도 제한 비활성화
QHttpServerConfiguration::QHttpServerConfiguration(const QHttpServerConfiguration &other)
복사 - 이 QHttpServerConfiguration을 구성합니다.
[noexcept]
QHttpServerConfiguration::QHttpServerConfiguration(QHttpServerConfiguration &&other)
이동-다음에서 이 QHttpServerConfiguration을 구성합니다. other
[noexcept]
QHttpServerConfiguration::~QHttpServerConfiguration()
파괴자.
[since 6.10]
QSpan<const std::pair<QHostAddress, int>> QHttpServerConfiguration::blacklist() const
QHttpServer 에 의해 접근이 거부된 서브넷의 블랙리스트를 반환합니다.
이 함수는 Qt 6.10에 도입되었습니다.
setBlacklist()도 참조하십시오 .
[since 6.10]
std::chrono::seconds QHttpServerConfiguration::keepAliveTimeout() const
QHttpServer 에서 사용하는 킵얼라이브 타임아웃을 반환합니다.
이 함수는 Qt 6.10에 도입되었습니다.
setKeepAliveTimeout()도 참조하십시오 .
quint32 QHttpServerConfiguration::rateLimitPerSecond() const
서버가 수락한 IP당 초당 최대 수신 요청 수를 반환합니다.
setRateLimitPerSecond()도 참조하세요 .
[since 6.10]
void QHttpServerConfiguration::setBlacklist(QSpan<const std::pair<QHostAddress, int>> subnetList)
subnetList 을 서브넷의 블랙리스트로 설정합니다.
이 목록의 IP 주소는 QHttpServer 에 의해 액세스가 거부됩니다. 블랙리스트는 화이트리스트가 비어 있을 때만 활성화됩니다.
이 기능은 Qt 6.10에 도입되었습니다.
blacklist(), setWhitelist() 및 QHostAddress::parseSubnet()도 참조하세요 .
[since 6.10]
void QHttpServerConfiguration::setKeepAliveTimeout(std::chrono::seconds timeout)
QHttpServer 에 대한 연결 유지 시간 제한을 timeout 으로 설정합니다.
연결 유지 시간 제한은 유휴 연결이 닫히기 전에 열린 상태로 유지되는 시간을 결정합니다. 기본적으로 타임아웃은 15초로 설정되어 있습니다.
이 기능은 Qt 6.10에 도입되었습니다.
keepAliveTimeout()도 참조하세요 .
void QHttpServerConfiguration::setRateLimitPerSecond(quint32 maxRequests)
QHttpServer 에서 허용할 IP당 초당 최대 수신 요청 수로 maxRequests 을 설정합니다. 제한을 초과하면 QHttpServer 은 QHttpServerResponder::StatusCode::TooManyRequests 으로 응답합니다.
rateLimitPerSecond() 및 QHttpServerResponder::StatusCode 을참조하세요 .
[since 6.10]
void QHttpServerConfiguration::setWhitelist(QSpan<const std::pair<QHostAddress, int>> subnetList)
subnetList 을 허용 서브넷의 화이트리스트로 설정합니다.
목록이 비어 있지 않으면 이 목록에 있는 IP 주소만 QHttpServer 에서 허용됩니다. 화이트리스트는 블랙리스트보다 우선합니다.
각 서브넷은 다음과 같이 구성된 쌍으로 표시됩니다:
- QHostAddress 유형의 기본 IP 주소.
- 서브넷 마스크를 정의하는 int 타입의 CIDR 접두사 길이.
특정 IP 주소만 허용하려면 IPv4의 경우 접두사 길이 32(예: "192.168.1.100/32"
)를, IPv6의 경우 128(예: "2001:db8::1/128"
)을 사용합니다.
이 기능은 Qt 6.10에 도입되었습니다.
whitelist(), setBlacklist() 및 QHostAddress::parseSubnet()도 참조하십시오 .
[noexcept]
void QHttpServerConfiguration::swap(QHttpServerConfiguration &other)
이 구성을 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.
[since 6.10]
QSpan<const std::pair<QHostAddress, int>> QHttpServerConfiguration::whitelist() const
QHttpServer 에서 허용하는 서브넷의 화이트리스트를 반환합니다.
이 함수는 Qt 6.10에 도입되었습니다.
setWhitelist()도 참조하십시오 .
[noexcept]
QHttpServerConfiguration &QHttpServerConfiguration::operator=(QHttpServerConfiguration &&other)
이동 - other 을 이 QHttpServerConfiguration 에 할당합니다.
QHttpServerConfiguration &QHttpServerConfiguration::operator=(const QHttpServerConfiguration &other)
other 을 QHttpServerConfiguration 으로 복사-할당합니다.
관련 비회원
[noexcept]
bool operator!=(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs)
lhs 과 rhs 에 동일한 구성 매개변수 집합이 없는 경우 true
을 반환합니다.
[noexcept]
bool operator==(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs)
lhs 과 rhs 의 구성 매개변수 집합이 동일한 경우 true
를 반환합니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.