Update proxy.py (#66)

This commit is contained in:
theNekoMoe 2022-08-09 06:20:44 +08:00 committed by GitHub
parent 794042d65f
commit 97b383e8d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ def next_layer(nextlayer: layer.NextLayer):
f"{nextlayer.data_client()[:70]=}\n"
)
sni = nextlayer.context.client.sni
if nextlayer.context.client.tls and sni and (sni.endswith("yuanshen.com") or sni.endswith("mihoyo.com") or sni.endswith("hoyoverse.com") or sni.endswith("starrails.com")):
if nextlayer.context.client.tls and sni and (sni.endswith("yuanshen.com") or sni.endswith("mihoyo.com") or sni.endswith("hoyoverse.com") or sni.endswith("starrails.com") or sni.endswith("bhsr.com")):
ctx.log('sni:' + sni)
nextlayer.context.server.address = ("127.0.0.1", 443)
@ -33,4 +33,4 @@ def request(flow: http.HTTPFlow) -> None:
b"404 not found", # (optional) content
{"Content-Type": "text/html"} # (optional) headers
)
return
return