capture path/uri when connecting, and pass it back through callbacks in the openInfo member

This commit is contained in:
Benjamin Sergeant
2019-01-03 17:44:10 -08:00
parent 6ac3bdb94a
commit bd1c8873d0
13 changed files with 64 additions and 42 deletions

View File

@ -41,6 +41,20 @@ namespace ix
WebSocket_MessageType_Pong = 5
};
struct WebSocketOpenInfo
{
std::string uri;
WebSocketHttpHeaders headers;
WebSocketOpenInfo(const std::string& u = std::string(),
const WebSocketHttpHeaders& h = WebSocketHttpHeaders())
: uri(u)
, headers(h)
{
;
}
};
struct WebSocketCloseInfo
{
uint16_t code;
@ -59,8 +73,9 @@ namespace ix
const std::string&,
size_t wireSize,
const WebSocketErrorInfo&,
const WebSocketCloseInfo&,
const WebSocketHttpHeaders&)>;
const WebSocketOpenInfo&,
const WebSocketCloseInfo&)>;
using OnTrafficTrackerCallback = std::function<void(size_t size, bool incoming)>;
class WebSocket