MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / proxy_server

Function proxy_server

tests/stream/test_proxy_server_lifecycle.py:48–58  ·  view source on GitHub ↗

Create ProxyServer with mocked dependencies.

(mock_deps)

Source from the content-addressed store, hash-verified

46
47@pytest.fixture
48def proxy_server(mock_deps):
49 """Create ProxyServer with mocked dependencies."""
50 queue = multiprocessing.Queue()
51 # Immediately call cancel_join_thread to prevent feeder thread from hanging the process
52 queue.cancel_join_thread()
53 server = ProxyServer(
54 host="127.0.0.1", port=3120, intercept_domains=["*.google.com"], queue=queue
55 )
56 yield server
57 # Explicitly close the queue to release resources
58 queue.close()
59
60
61# ==================== TESTS: handle_client ====================

Callers

nothing calls this directly

Calls 2

ProxyServerClass · 0.90
closeMethod · 0.80

Tested by

no test coverage detected