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

Function proxy_server

tests/stream/test_proxy_server_forwarding.py:127–138  ·  view source on GitHub ↗

Create ProxyServer instance with mocked dependencies.

(mock_cert_manager, mock_proxy_connector, mock_interceptor)

Source from the content-addressed store, hash-verified

125
126@pytest.fixture
127def proxy_server(mock_cert_manager, mock_proxy_connector, mock_interceptor):
128 """Create ProxyServer instance with mocked dependencies."""
129 with patch("logging.getLogger"):
130 queue = multiprocessing.Queue()
131 # Immediately call cancel_join_thread to prevent feeder thread from hanging the process
132 queue.cancel_join_thread()
133 server = ProxyServer(
134 host="127.0.0.1", port=3120, intercept_domains=["*.google.com"], queue=queue
135 )
136 yield server
137 # Explicitly close the queue to release resources
138 queue.close()
139
140
141# ==================== TESTS: _forward_data (No Interception) ====================

Callers

nothing calls this directly

Calls 2

ProxyServerClass · 0.90
closeMethod · 0.80

Tested by

no test coverage detected