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

Method should_intercept

stream/proxy_server.py:77–93  ·  view source on GitHub ↗

Determine if the connection to the host should be intercepted

(self, host)

Source from the content-addressed store, hash-verified

75 pass
76
77 def should_intercept(self, host):
78 """
79 Determine if the connection to the host should be intercepted
80 """
81 if host in self.passthrough_domains:
82 return False
83
84 if host in self.intercept_domains:
85 return True
86
87 for d in self.intercept_domains:
88 if d.startswith("*."):
89 suffix = d[1:]
90 if host.endswith(suffix):
91 return True
92
93 return False
94
95 async def handle_client(
96 self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter

Callers 5

_handle_connectMethod · 0.95
test_should_interceptFunction · 0.45
test_should_interceptMethod · 0.45
test_should_interceptMethod · 0.45

Calls

no outgoing calls

Tested by 4

test_should_interceptFunction · 0.36
test_should_interceptMethod · 0.36
test_should_interceptMethod · 0.36