LibVNCServer/LibVNCClient
Macros | Functions
websockets.c File Reference
#include <rfb/rfb.h>
#include <errno.h>
#include <string.h>
#include "rfb/rfbconfig.h"
#include "rfbssl.h"
#include "crypto.h"
#include "ws_decode.h"
#include "base64.h"
+ Include dependency graph for websockets.c:

Go to the source code of this file.

Macros

#define GUID   "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
 
#define SERVER_HANDSHAKE_HYBI   "HTTP/1.1 101 Switching Protocols\r\n\Upgrade: websocket\r\n\Connection: Upgrade\r\n\Sec-WebSocket-Accept: %s\r\n\Sec-WebSocket-Protocol: %s\r\n\\r\n"
 
#define SERVER_HANDSHAKE_HYBI_NO_PROTOCOL   "HTTP/1.1 101 Switching Protocols\r\n\Upgrade: websocket\r\n\Connection: Upgrade\r\n\Sec-WebSocket-Accept: %s\r\n\\r\n"
 
#define WEBSOCKETS_CLIENT_CONNECT_WAIT_MS   100
 
#define WEBSOCKETS_CLIENT_SEND_WAIT_MS   100
 
#define WEBSOCKETS_MAX_HANDSHAKE_LEN   4096
 

Functions

rfbBool webSocketsCheck (rfbClientPtr cl)
 
int webSocketsEncode (rfbClientPtr cl, const char *src, int len, char **dst)
 
int webSocketsDecode (rfbClientPtr cl, char *dst, int len)
 
rfbBool webSocketCheckDisconnect (rfbClientPtr cl)
 This is a stub function that was once used for Hixie-encoding. More...
 
rfbBool webSocketsHasDataInBuffer (rfbClientPtr cl)
 

Macro Definition Documentation

◆ GUID

#define GUID   "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"

Definition at line 68 of file websockets.c.

◆ SERVER_HANDSHAKE_HYBI

#define SERVER_HANDSHAKE_HYBI   "HTTP/1.1 101 Switching Protocols\r\n\Upgrade: websocket\r\n\Connection: Upgrade\r\n\Sec-WebSocket-Accept: %s\r\n\Sec-WebSocket-Protocol: %s\r\n\\r\n"

Definition at line 70 of file websockets.c.

◆ SERVER_HANDSHAKE_HYBI_NO_PROTOCOL

#define SERVER_HANDSHAKE_HYBI_NO_PROTOCOL   "HTTP/1.1 101 Switching Protocols\r\n\Upgrade: websocket\r\n\Connection: Upgrade\r\n\Sec-WebSocket-Accept: %s\r\n\\r\n"

Definition at line 77 of file websockets.c.

◆ WEBSOCKETS_CLIENT_CONNECT_WAIT_MS

#define WEBSOCKETS_CLIENT_CONNECT_WAIT_MS   100

Definition at line 83 of file websockets.c.

◆ WEBSOCKETS_CLIENT_SEND_WAIT_MS

#define WEBSOCKETS_CLIENT_SEND_WAIT_MS   100

Definition at line 84 of file websockets.c.

◆ WEBSOCKETS_MAX_HANDSHAKE_LEN

#define WEBSOCKETS_MAX_HANDSHAKE_LEN   4096

Definition at line 85 of file websockets.c.

Function Documentation

◆ webSocketCheckDisconnect()

rfbBool webSocketCheckDisconnect ( rfbClientPtr  cl)

This is a stub function that was once used for Hixie-encoding.

We keep it for API compatibility.

Definition at line 441 of file websockets.c.

◆ webSocketsCheck()

rfbBool webSocketsCheck ( rfbClientPtr  cl)

Definition at line 123 of file websockets.c.

+ Here is the call graph for this function:

◆ webSocketsDecode()

int webSocketsDecode ( rfbClientPtr  cl,
char *  dst,
int  len 
)

Definition at line 429 of file websockets.c.

+ Here is the call graph for this function:

◆ webSocketsEncode()

int webSocketsEncode ( rfbClientPtr  cl,
const char *  src,
int  len,
char **  dst 
)

Definition at line 423 of file websockets.c.

◆ webSocketsHasDataInBuffer()

rfbBool webSocketsHasDataInBuffer ( rfbClientPtr  cl)

Definition at line 451 of file websockets.c.

+ Here is the call graph for this function: