fix: load balancer panics, stealth flag, shadow DOM polyfill
Fixes #1: replace unwrap() panics in run_multi_worker_serve with match on the Result. Fixes #2: route /json round-robin via worker_port instead of hardcoded port+1. Fixes #3: return 502 Bad Gateway when a worker is unreachable instead of silently dropping the connection. Fixes #5: thread --stealth through start_with_options -> CdpContext -> BrowserContext::with_options so the flag actually has an effect in serve mode (was let _ before). Log message now reflects the actual capability based on the stealth cargo feature being compiled in. Fixes #15: try/catch the parentNode assignment in the attachShadow polyfill so it doesn't throw a TypeError against the read-only Node.parentNode getter (Cloudflare Turnstile triggers this path).
This commit is contained in:
1 parent
74cf88d0f4
commit
99e75f1e62
4 files changed
+106
-24
No files matched your search
@@ -31,11 +31,19 @@ pub struct CdpContext {
|
||||
|
||||
impl CdpContext {
|
||||
pub fn new() -> Self {
|
||||
Self::new_with_proxy(None)
|
||||
Self::new_with_options(None, false)
|
||||
}
|
||||
|
||||
pub fn new_with_proxy(proxy: Option<String>) -> Self {
|
||||
let default_context = Arc::new(BrowserContext::with_proxy("default".to_string(), proxy));
|
||||
Self::new_with_options(proxy, false)
|
||||
}
|
||||
|
||||
pub fn new_with_options(proxy: Option<String>, stealth: bool) -> Self {
|
||||
let default_context = Arc::new(BrowserContext::with_options(
|
||||
"default".to_string(),
|
||||
proxy,
|
||||
stealth,
|
||||
));
|
||||
CdpContext {
|
||||
pages: Vec::new(),
|
||||
sessions: HashMap::new(),
|
||||
|
||||
Reference in new issue
Block a user