Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.48 KB

File metadata and controls

36 lines (31 loc) · 1.48 KB
description How to setup, debug, and execute the DeepSeek Playwright API proxy

DeepSeek API Proxy Workflow

This workflow manages the local Enterprise Reverse Proxy, mapping strict OpenAI POST /v1/chat/completions API queries to dynamic Playwright scraping on Microsoft Edge.

Step 1: Dependencies and Initialization

Ensure you are inside deepseek-proxy/ and execute the following:

npm install express cors dotenv playwright

Step 2: Ensure Playwright Chromium is Operational

The BrowserManager (src/services/BrowserManager.js) inherently requires Microsoft Edge to bypass Google Bot Detection:

channel: process.env.PLAYWRIGHT_CHANNEL || 'msedge',
  • If the server crashes on boot, check the .env configuration.
  • If Google blocks login, ensure stealth mode navigator.webdriver=undefined is loaded inside BrowserManager.js.

Step 3: Start the Proxy

// turbo-all

cd c:\Users\jonub\Downloads\deepseek-proxy
node server.js

Step 4: Interfacing with the API

The standard OpenAI payload maps perfectly inside src/controllers/chatController.js. Ask downstream testing agents to trigger it via:

curl -X POST http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-web","messages":[{"role":"user","content":"Ping!"}]}'

Wait for the response! The proxy uses a Smart DOM length polling loop and only scrapes when the text length has stayed identical for 3 consecutive seconds.