aboutsummaryrefslogtreecommitdiff
path: root/websocksy.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-05-18 19:44:03 +0200
committercbdev <cb@cbcdn.com>2019-05-18 19:44:03 +0200
commitf985ad1a4c11a8676ccd14d87fd11cd2c6dd75a6 (patch)
treef91312409c1d9201c0e519ce0455d40d6e5bbbf2 /websocksy.h
parent49ce320f17729a0cf0df0bd1322639ddf55e2402 (diff)
downloadwebsocksy-f985ad1a4c11a8676ccd14d87fd11cd2c6dd75a6.tar.gz
websocksy-f985ad1a4c11a8676ccd14d87fd11cd2c6dd75a6.tar.bz2
websocksy-f985ad1a4c11a8676ccd14d87fd11cd2c6dd75a6.zip
Closing a websocket may send a reason
Diffstat (limited to 'websocksy.h')
-rw-r--r--websocksy.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/websocksy.h b/websocksy.h
index dd34959..2073287 100644
--- a/websocksy.h
+++ b/websocksy.h
@@ -8,7 +8,8 @@
typedef enum {
ws_new = 0,
ws_http,
- ws_open
+ ws_open,
+ ws_closed
} ws_state;
//RFC Section 5.2
@@ -21,6 +22,19 @@ typedef enum {
ws_frame_pong = 10
} ws_operation;
+//RFC Section 7.4.1
+typedef enum {
+ ws_close_http = 100,
+ ws_close_normal = 1000,
+ ws_close_shutdown = 1001,
+ ws_close_proto = 1002,
+ ws_close_data = 1003,
+ ws_close_format = 1007,
+ ws_close_policy = 1008,
+ ws_close_limit = 1009,
+ ws_close_unexpected = 1011
+} ws_close_reason;
+
struct {
char* host;
char* port;