Merge pull request #1295 from l-n-s/websocket_support

Support websocket connections over HTTP proxy
This commit is contained in:
orignal authored and GitHub committed 2019-02-12 12:30:44 -05:00
commit a463dbc5fb
2 files changed
+12 -2

No files matched your search

+5 -1
View File
@@ -219,7 +219,11 @@ namespace proxy {
/* replace headers */
req.UpdateHeader("User-Agent", "MYOB/6.66 (AN/ON)");
/* add headers */
req.UpdateHeader("Connection", "close"); /* keep-alive conns not supported yet */
/* close connection, if not Connection: (U|u)pgrade (for websocket) */
auto h = req.GetHeader ("Connection");
auto x = h.find("pgrade");
if (!(x != std::string::npos && std::tolower(h[x - 1]) == 'u'))
req.UpdateHeader("Connection", "close");
}
/**