mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Merge pull request #1295 from l-n-s/websocket_support
Support websocket connections over HTTP proxy
This commit is contained in:
commit
a463dbc5fb
2 changed files with 12 additions and 2 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue