Support websocket connections over HTTP proxy

This commit is contained in:
l-n-s 2019-02-11 17:18:01 -05:00
parent 80ffe13f3e
commit f617b27110
2 changed files with 8 additions and 2 deletions

View file

@ -219,7 +219,9 @@ 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 */
auto h = req.GetHeader ("Connection");
if (h.find("upgrade") == std::string::npos && h.find("Upgrade") == std::string::npos)
req.UpdateHeader("Connection", "close"); /* close everything, except websocket */
}
/**