diff --git a/lib/core-net/vhost.c b/lib/core-net/vhost.c index ec5349e0f..0ba451cdb 100644 --- a/lib/core-net/vhost.c +++ b/lib/core-net/vhost.c @@ -156,6 +156,9 @@ lws_role_call_adoption_bind(struct lws *wsi, int type, const char *prot) lwsl_err("%s: can't find role '%s'\n", __func__, wsi->a.vhost->listen_accept_role); + if (!strcmp(wsi->a.vhost->listen_accept_role, "raw-proxy")) + type |= LWS_ADOPT_FLAG_RAW_PROXY; + if (role && lws_rops_fidx(role, LWS_ROPS_adoption_bind)) { n = (lws_rops_func_fidx(role, LWS_ROPS_adoption_bind)). adoption_bind(wsi, type, prot); diff --git a/lib/roles/raw-proxy/ops-raw-proxy.c b/lib/roles/raw-proxy/ops-raw-proxy.c index 93e5cb5e4..cac95a6da 100644 --- a/lib/roles/raw-proxy/ops-raw-proxy.c +++ b/lib/roles/raw-proxy/ops-raw-proxy.c @@ -48,6 +48,9 @@ rops_handle_POLLIN_raw_proxy(struct lws_context_per_thread *pt, struct lws *wsi, return LWS_HPI_RET_HANDLED; } + if (lwsi_state(wsi) == LRS_WAITING_CONNECT) + goto try_pollout; + if ((pollfd->revents & pollfd->events & LWS_POLLIN) && /* any tunnel has to have been established... */ lwsi_state(wsi) != LRS_SSL_ACK_PENDING &&