ws connect has a new option to send HTTP headers + use WebSocketHttpHeaders instead of unordered_map<string, string>

This commit is contained in:
Benjamin Sergeant
2019-08-26 10:19:09 -07:00
parent 0847e60d2a
commit d3e5a63fa2
12 changed files with 66 additions and 12 deletions

View File

@ -109,6 +109,7 @@ int main(int argc, char** argv)
CLI::App* connectApp = app.add_subcommand("connect", "Connect to a remote server");
connectApp->add_option("url", url, "Connection url")->required();
connectApp->add_option("-H", headers, "Header")->join();
connectApp->add_flag("-d", disableAutomaticReconnection, "Disable Automatic Reconnection");
connectApp->add_flag("-x", disablePerMessageDeflate, "Disable per message deflate");
connectApp->add_flag("-b", binaryMode, "Send in binary mode");
@ -252,7 +253,7 @@ int main(int argc, char** argv)
}
else if (app.got_subcommand("connect"))
{
ret = ix::ws_connect_main(url, disableAutomaticReconnection,
ret = ix::ws_connect_main(url, headers, disableAutomaticReconnection,
disablePerMessageDeflate, binaryMode);
}
else if (app.got_subcommand("chat"))