BOM发料对比

This commit is contained in:
hjq
2026-06-26 17:20:04 +08:00
parent 872caec9c7
commit c197c6776d

View File

@@ -67,12 +67,13 @@ def patch_drission_ws_handshake() -> None:
# Chrome 149 增强了 DevTools 的安全校验。
# Host header 必须是 IP 地址或 localhost且必须包含端口号
# 注意websocket-client 会自动生成 Host 头,如果这里手动加上会导致发送重复的 Host 头,从而被 Chrome 500 拒绝。
candidate_kwargs = [
# 策略1最标准的 localhost 组合,带端口
# 策略1最标准的 localhost 组合,不手动加 Host 避免重复
{
**base_kwargs,
"suppress_origin": False,
"header": [f"Host: 127.0.0.1:{port}", "Origin: http://127.0.0.1"]
"header": ["Origin: http://127.0.0.1"]
},
# 策略2最原始、最干净的连接方式类似 curl
{
@@ -80,11 +81,11 @@ def patch_drission_ws_handshake() -> None:
"suppress_origin": True,
"header": []
},
# 策略3伪装成 localhost 带端口
# 策略3伪装成 localhost
{
**base_kwargs,
"suppress_origin": False,
"header": [f"Host: localhost:{port}", "Origin: http://localhost"]
"header": ["Origin: http://localhost"]
}
]