bwi/v2.3.0 #29

Merged
bartoszek merged 38 commits from bwi/v2.3.0 into main 2025-09-11 08:32:43 +00:00
Showing only changes of commit b6bf3792d8 - Show all commits

View File

@ -43,13 +43,6 @@ class WebSocket {
RublonEventData * currentEvent{nullptr};
std::pmr::string proxyUrl{};
// constexpr static const struct lws_protocol_vhost_options pvo = {
// NULL, /* "next" pvo linked-list /
// &pvo_proxy_uri, / "child" pvo linked-list /
// "push_protocol", / protocol name we belong to on this vhost /
// "" / ignored */
// };
public:
WebSocket(const Configuration & config) : _config{config}, urlv{_config.get().apiServer}, proxyUrl{_config.get().apiServer.get_allocator()} {
const auto & cfg = _config.get(); // only a alias to not use _config.get() all the time
@ -70,7 +63,11 @@ class WebSocket {
log(rlevel, "libwesockets: %s", line);
};
if(_config.get().logging) {
lws_set_log_level(LLL_ERR | LLL_WARN | LLL_NOTICE | LLL_INFO | LLL_DEBUG | LLL_HEADER, lws_log_emit);
} else {
lws_set_log_level(LLL_ERR | LLL_WARN, lws_log_emit);
}
memset(&info, 0, sizeof(info));
memset(&ccinfo, 0, sizeof(ccinfo));
@ -85,8 +82,8 @@ class WebSocket {
log(LogLevel::Debug, "WebSocket using proxy");
// "username:password\@server:port"
proxyUrl.reserve(conservative_estimate(cfg.proxyUsername, cfg.proxyPass, cfg.proxyHost) + 10);
if(cfg.proxyAuthRequired) {
proxyUrl.reserve(conservative_estimate(cfg.proxyUsername, cfg.proxyPass, cfg.proxyHost) + 10);
proxyUrl += *cfg.proxyUsername;
proxyUrl += ":";
proxyUrl += *cfg.proxyPass;