1616#include < iostream>
1717#include < streambuf>
1818
19- #include " HTTPConnection.hpp"
20- #include " HTTPSConnection.hpp"
21- // #include "ConnectionContext.hpp"
19+ #include " ConnectionContext.hpp"
2220
2321namespace httpsserver
2422{
@@ -56,7 +54,7 @@ class WebsocketInputStreambuf : public std::streambuf
5654{
5755 public:
5856 WebsocketInputStreambuf (
59- HTTPConnection *socket ,
57+ ConnectionContext *con ,
6058 size_t dataLength,
6159 uint8_t *_ = nullptr ,
6260 size_t bufferSize = 2048 );
@@ -67,7 +65,7 @@ class WebsocketInputStreambuf : public std::streambuf
6765
6866 private:
6967 char *_buffer;
70- HTTPConnection *_con;
68+ ConnectionContext *_con;
7169 size_t _dataLength;
7270 size_t _bufferSize;
7371 size_t _sizeRead;
@@ -98,15 +96,15 @@ class Websocket
9896 static const uint8_t SEND_TYPE_BINARY = 0x01 ;
9997 static const uint8_t SEND_TYPE_TEXT = 0x02 ;
10098
101- Websocket (HTTPConnection *con);
99+ Websocket (ConnectionContext *con);
102100 ~Websocket ();
103101 int read ();
104102 void close (uint16_t status = CLOSE_NORMAL_CLOSURE, std::string message = " " );
105103 void send (std::string data, uint8_t sendType = SEND_TYPE_BINARY);
106104 void send (uint8_t *data, uint16_t length, uint8_t sendType = SEND_TYPE_BINARY);
107105
108106 private:
109- HTTPConnection *_con;
107+ ConnectionContext *_con;
110108 WebsocketHandler *_wsHandler;
111109 bool _receivedClose; // True when we have received a close request.
112110 bool _sentClose; // True when we have sent a close request.
0 commit comments