Fix proxy for websockets
This commit is contained in:
parent
c1806bc911
commit
b629f2d7e1
@ -78,9 +78,7 @@ class WebSocket {
|
|||||||
info.port = CONTEXT_PORT_NO_LISTEN;
|
info.port = CONTEXT_PORT_NO_LISTEN;
|
||||||
info.protocols = protocols;
|
info.protocols = protocols;
|
||||||
info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
||||||
|
|
||||||
context = lws_create_context(&info);
|
|
||||||
|
|
||||||
if(cfg.proxyEnabled && (cfg.proxyType == "http" || cfg.proxyType == "https")) {
|
if(cfg.proxyEnabled && (cfg.proxyType == "http" || cfg.proxyType == "https")) {
|
||||||
assert(cfg.proxyType.has_value());
|
assert(cfg.proxyType.has_value());
|
||||||
assert(cfg.proxyHost.has_value());
|
assert(cfg.proxyHost.has_value());
|
||||||
@ -100,6 +98,8 @@ class WebSocket {
|
|||||||
info.http_proxy_address = proxyUrl.c_str();
|
info.http_proxy_address = proxyUrl.c_str();
|
||||||
info.http_proxy_port = config.proxyPort.value_or(8080);
|
info.http_proxy_port = config.proxyPort.value_or(8080);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context = lws_create_context(&info);
|
||||||
|
|
||||||
const std::string_view prefix = "https://";
|
const std::string_view prefix = "https://";
|
||||||
if(urlv.substr(0, prefix.size()) == prefix)
|
if(urlv.substr(0, prefix.size()) == prefix)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user