krystv commited on
Commit
3587b18
·
verified ·
1 Parent(s): f812c95

Upload crates/bex-core/src/config.rs

Browse files
Files changed (1) hide show
  1. crates/bex-core/src/config.rs +6 -6
crates/bex-core/src/config.rs CHANGED
@@ -26,9 +26,7 @@ pub struct EngineConfig {
26
  pub js_memory_limit_mb: u32,
27
  pub js_timeout_ms: u32,
28
  pub js_context_idle_ttl_secs: u64,
29
- /// How long a worker thread can be idle before the pool shrinks (default: 120s).
30
  pub js_worker_idle_ttl_secs: u64,
31
- /// Maximum stack size per JS worker in bytes (default: 512KB).
32
  pub js_max_stack_bytes: usize,
33
  }
34
 
@@ -40,13 +38,15 @@ impl Default for EngineConfig {
40
  Self {
41
  data_dir: PathBuf::from("./bex"),
42
  host_version: "1.0.0".into(),
43
- user_agent: "BexEngine/6.0".into(),
44
- http_timeout_ms: 15_000,
 
 
45
  memory_limit_mb: 64,
46
  fuel_per_call: 500_000_000,
47
  fuel_compute_heavy: 1_000_000_000,
48
  fuel_io_heavy: 100_000_000,
49
- call_timeout_ms: 15_000,
50
  max_response_bytes: 10 * 1024 * 1024,
51
  max_concurrent_calls: 32,
52
  log_level: LogLevel::Info,
@@ -54,7 +54,7 @@ impl Default for EngineConfig {
54
  circuit_breaker_threshold: 5,
55
  circuit_breaker_cooldown_ms: 30_000,
56
  http_pool_idle_timeout_ms: 90_000,
57
- http_pool_max_idle_per_host: 4,
58
  js_initial_workers: 2,
59
  js_max_workers: cpu_count.min(4),
60
  js_memory_limit_mb: 32,
 
26
  pub js_memory_limit_mb: u32,
27
  pub js_timeout_ms: u32,
28
  pub js_context_idle_ttl_secs: u64,
 
29
  pub js_worker_idle_ttl_secs: u64,
 
30
  pub js_max_stack_bytes: usize,
31
  }
32
 
 
38
  Self {
39
  data_dir: PathBuf::from("./bex"),
40
  host_version: "1.0.0".into(),
41
+ // CRITICAL: Use a real browser User-Agent, NOT "BexEngine/6.0"
42
+ // The old "BexEngine/6.0" was immediately flagged by Cloudflare
43
+ user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36".into(),
44
+ http_timeout_ms: 30_000, // Increased from 15s — some CF challenges take time
45
  memory_limit_mb: 64,
46
  fuel_per_call: 500_000_000,
47
  fuel_compute_heavy: 1_000_000_000,
48
  fuel_io_heavy: 100_000_000,
49
+ call_timeout_ms: 30_000, // Increased from 15s for CF challenge pages
50
  max_response_bytes: 10 * 1024 * 1024,
51
  max_concurrent_calls: 32,
52
  log_level: LogLevel::Info,
 
54
  circuit_breaker_threshold: 5,
55
  circuit_breaker_cooldown_ms: 30_000,
56
  http_pool_idle_timeout_ms: 90_000,
57
+ http_pool_max_idle_per_host: 8, // Increased for better connection reuse
58
  js_initial_workers: 2,
59
  js_max_workers: cpu_count.min(4),
60
  js_memory_limit_mb: 32,