aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/protocolwebsocket.h
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2021-10-04 11:42:36 -0700
committerMike Buland <mbuland@penny-arcade.com>2021-10-04 11:42:36 -0700
commit4e91dc4f2d6eba2e66dd5b59445abcc778117c60 (patch)
tree4d8cd4e8016e222f5eccdf26674a097da3f7fb06 /src/unstable/protocolwebsocket.h
parent5cda6d3a1622167c5fed35bcd3a02a031ef7a86d (diff)
downloadlibbu++-4e91dc4f2d6eba2e66dd5b59445abcc778117c60.tar.gz
libbu++-4e91dc4f2d6eba2e66dd5b59445abcc778117c60.tar.bz2
libbu++-4e91dc4f2d6eba2e66dd5b59445abcc778117c60.tar.xz
libbu++-4e91dc4f2d6eba2e66dd5b59445abcc778117c60.zip
Added handler to check/modify http headers.
This is an extra call that happens during the http handshake that allows the implementation to set additional headers, modify existing headers, and cancel the whole connection if desired.
Diffstat (limited to 'src/unstable/protocolwebsocket.h')
-rw-r--r--src/unstable/protocolwebsocket.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/unstable/protocolwebsocket.h b/src/unstable/protocolwebsocket.h
index 6778ea5..e5ff804 100644
--- a/src/unstable/protocolwebsocket.h
+++ b/src/unstable/protocolwebsocket.h
@@ -35,6 +35,12 @@ namespace Bu
35 virtual void onNewConnection( Bu::Client *pClient ); 35 virtual void onNewConnection( Bu::Client *pClient );
36 virtual void onNewData( Bu::Client *pClient ); 36 virtual void onNewData( Bu::Client *pClient );
37 37
38 /**
39 * Return true to continue the connection, return false to disconnect.
40 * Feel free to modify the headers out list to add or remove http
41 * headers to go to the client.
42 */
43 virtual bool onProcessHeaders( Bu::StringList &lHeadersOut );
38 virtual void onHandshakeComplete()=0; 44 virtual void onHandshakeComplete()=0;
39 virtual void onNewMessage( const Bu::String &sData, Operation eOp )=0; 45 virtual void onNewMessage( const Bu::String &sData, Operation eOp )=0;
40 void writeMessage( const Bu::String &sData, Operation eOp=Text ); 46 void writeMessage( const Bu::String &sData, Operation eOp=Text );