summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-08 18:50:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-08 18:50:08 +0300
commitbb3b89fd5d857d396050d02bc185d765760de6ff (patch)
treefc5765cbde415fedb0d3faadc9b64e32fd901a14 /include
parent8d0500df234fc5b59ea7687bd5f55f19d7b8e28c (diff)
WebSocket related code moved to the core
Diffstat (limited to 'include')
-rw-r--r--include/m_netlib.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/m_netlib.h b/include/m_netlib.h
index 21b6389c5a..798313cbbd 100644
--- a/include/m_netlib.h
+++ b/include/m_netlib.h
@@ -774,6 +774,30 @@ EXTERN_C MIR_APP_DLL(void) Netlib_DestroySecurityProvider(HANDLE hProvider);
EXTERN_C MIR_APP_DLL(char*) Netlib_NtlmCreateResponse(HANDLE hProvider, const char *szChallenge, wchar_t *szLogin, wchar_t *szPass, unsigned &complete);
/////////////////////////////////////////////////////////////////////////////////////////
+// WebSocket support
+
+struct WSHeader
+{
+ WSHeader()
+ {
+ memset(this, 0, sizeof(*this));
+ }
+
+ bool bIsFinal, bIsMasked;
+ int opCode, firstByte;
+ size_t payloadSize, headerSize;
+};
+
+// connects to a WebSocket server
+EXTERN_C MIR_APP_DLL(HNETLIBCONN) WebSocket_Connect(HNETLIBUSER, const char *szHost);
+
+// validates that the provided buffer contains full WebSocket datagram
+EXTERN_C MIR_APP_DLL(bool) WebSocket_InitHeader(WSHeader &hdr, const void *pData, size_t bufSize);
+
+// sends a packet to WebSocket
+EXTERN_C MIR_APP_DLL(void) WebSocket_Send(HNETLIBCONN nlc, const void *pData, size_t strLen);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// Netlib hooks (0.8+)
// WARNING: these hooks are being called in the context of the calling thread, without switching