orinium_browser/platform/network/
config.rs1use std::time::Duration;
4
5#[derive(Debug, Clone)]
7pub struct NetworkConfig {
8 pub user_agent: String,
10
11 pub connect_timeout: Duration,
13 pub read_timeout: Duration,
14
15 pub enable_cache: bool,
17
18 pub enable_cookies: bool,
20
21 pub verify_tls: bool,
23
24 pub proxies: Vec<ProxyConfig>,
26
27 pub max_connections: usize,
29
30 pub follow_redirects: bool,
32
33 pub enable_websocket: bool,
35}
36
37#[allow(dead_code)]
38#[derive(Debug, Clone)]
39pub enum ProxyType {
40 Http,
41 Https,
42 Socks5,
43}
44
45#[allow(dead_code)]
46#[derive(Debug, Clone)]
47pub struct ProxyConfig {
48 pub proxy_type: String,
49 pub host: String,
50 pub port: u16,
51 pub username: Option<String>,
52 pub password: Option<String>,
53}
54
55#[allow(dead_code)]
56#[derive(Debug, Clone, Default)]
57pub struct ProxySettings {
58 pub proxies: Vec<ProxyConfig>, }
60
61impl Default for NetworkConfig {
62 fn default() -> Self {
63 Self {
64 user_agent: String::from(
65 "OrinionBrowser/0.1 (+https://github.com/Orinas-github/Orinium-browser)",
66 ),
67 connect_timeout: Duration::from_secs(10),
68 read_timeout: Duration::from_secs(30),
69 enable_cache: true,
70 enable_cookies: true,
71 verify_tls: true,
72 proxies: vec![],
73 max_connections: 100,
74 follow_redirects: true,
75 enable_websocket: true,
76 }
77 }
78}