diff --git a/app.py b/app.py index b84107d..00bc584 100644 --- a/app.py +++ b/app.py @@ -44,6 +44,10 @@ CORS(app) CAPTURE_DIR = Path(tempfile.gettempdir()) / "web_captures" CAPTURE_DIR.mkdir(exist_ok=True) +# agent-browser socket 目录 +os.environ.setdefault("AGENT_BROWSER_SOCKET_DIR", "/tmp/agent-browser-sockets") +Path(os.environ["AGENT_BROWSER_SOCKET_DIR"]).mkdir(exist_ok=True, parents=True) + class AgentBrowserSession: """agent-browser 会话管理器""" diff --git a/templates/index.html b/templates/index.html index 607fd14..de67b77 100644 --- a/templates/index.html +++ b/templates/index.html @@ -405,7 +405,7 @@ submitBtn.disabled = true; try { - const response = await fetch('http://localhost:16025/api/capture', { + const response = await fetch('/api/capture', { method: 'POST', headers: { 'Content-Type': 'application/json'