11 #include <Cutelyst/Context>
25 WebSocketPhaseHeaders,
28 WebSocketPhasePayload,
30 Q_ENUM(WebSocketPhase)
36 OpCodeReserved3 = 0x3,
37 OpCodeReserved4 = 0x4,
38 OpCodeReserved5 = 0x5,
39 OpCodeReserved6 = 0x6,
40 OpCodeReserved7 = 0x7,
44 OpCodeReservedB = 0xB,
45 OpCodeReservedC = 0xC,
46 OpCodeReservedD = 0xD,
47 OpCodeReservedE = 0xE,
55 void setupNewConnection(
Socket *sock)
override final;
59 qint64
doWrite(
const char *data, qint64 len)
override final;
64 bool webSocketSendTextMessage(
const QString &message)
override final;
66 bool webSocketSendBinaryMessage(
const QByteArray &message)
override final;
68 bool webSocketSendPing(
const QByteArray &payload)
override final;
70 bool webSocketClose(quint16 code,
const QString &reason)
override final;
72 inline void resetData()
override final
74 ProtocolData::resetData();
88 websocketUpgraded =
false;
98 virtual void socketDisconnected()
override final;
102 quint64 websocket_payload_size = 0;
103 quint32 websocket_need = 0;
104 quint32 websocket_mask = 0;
107 int websocket_start_of_frame = 0;
108 int websocket_phase = 0;
109 quint8 websocket_continue_opcode = 0;
110 quint8 websocket_finn_opcode = 0;
111 bool websocketUpgraded =
false;
114 bool webSocketHandshakeDo(
const QByteArray &key,
127 Type type()
const override;
135 inline void parseMethod(
const char *ptr,
const char *end,
Socket *sock)
const;
136 inline void parseHeader(
const char *ptr,
const char *end,
Socket *sock)
const;
143 bool usingFrontendProxy;
QHostAddress remoteAddress
TimePointSteady startOfRequest
bool writeHeaders(quint16 status, const Cutelyst::Headers &headers) override final
qint64 doWrite(const char *data, qint64 len) override final
void processingFinished() override final
The Cutelyst namespace holds all public Cutelyst API.
const char * constData() const const
qsizetype size() const const