QMaskGenerator Class
QMaskGenerator 클래스는 사용자 정의 32비트 마스크 생성기를 위한 추상 기본 클래스를 제공합니다. 더 보기...
| 헤더: | #include <QMaskGenerator> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WebSockets) target_link_libraries(mytarget PRIVATE Qt6::WebSockets) |
| qmake: | QT += websockets |
| 상속: | QObject |
공개 함수
| QMaskGenerator(QObject *parent = nullptr) | |
| virtual | ~QMaskGenerator() override |
| virtual quint32 | nextMask() = 0 |
| virtual bool | seed() = 0 |
상세 설명
RFC 6455에 명시된 WebSockets 사양에 따르면, 클라이언트에서 서버로 전송되는 모든 통신은 마스킹되어야 합니다. 이는 악의적인 스크립트가 비정상적으로 작동하는 프록시를 공격하는 것을 방지하기 위함입니다. 올바른 마스킹의 중요성에 대한 자세한 내용은 Lin-Shung Huang 등이 저술한 “Talking to Yourself for Fun and Profit”을 참조하십시오. 기본적으로 QWebSocket 은 상당히 안전한 QRandomGenerator::global()->generate() 함수를 사용합니다. 위 문서에서 언급된 공격에 대한 최선의 대책은 보안 연결(wss://)을 통해 QWebSocket 을 사용하는 것입니다. 일반적으로, 애플리케이션 내에서 제3자 스크립트가 QWebSocket 에 접근할 수 없도록 항상 주의해야 합니다.
멤버 함수 문서
[explicit] QMaskGenerator::QMaskGenerator(QObject *parent = nullptr)
지정된 선택적 매개변수 QObject parent 를 사용하여 새로운 QMaskGenerator 객체를 생성합니다.
[override virtual noexcept] QMaskGenerator::~QMaskGenerator()
QMaskGenerator 객체를 삭제합니다.
[pure virtual] quint32 QMaskGenerator::nextMask()
새로운 32비트 무작위 마스크를 반환합니다. 무작위성은 마스크를 생성하는 데 사용된 난수 생성기(RNG)에 따라 달라집니다.
[pure virtual] bool QMaskGenerator::seed()
난수 생성기에 시드를 설정하여 QMaskGenerator 를 초기화합니다. seed()가 호출되지 않을 경우, 기본 시드를 사용할지 아니면 시드를 전혀 사용하지 않을지는 하위 클래스의 구체적인 구현에 따라 다릅니다. 시드 설정이 성공하면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
© 2026 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.