feat: 支持 turn 中转,可以远程访问 h264/webrtc #197

This commit is contained in:
mofeng-git
2025-12-03 13:09:41 +08:00
parent aae4e936db
commit c8305cc65d
8 changed files with 202 additions and 13 deletions

View File

@@ -136,7 +136,12 @@ class Stun:
return (StunNatType.FULL_CONE_NAT, resp)
if first.changed is None:
raise RuntimeError(f"Changed addr is None: {first}")
get_logger(0).warning(
"STUN server %s:%d responded without CHANGED-ADDRESS; skipping NAT type detection",
self.__host,
self.__port,
)
return (StunNatType.ERROR, first)
resp = await self.__make_request("Change request [ext_ip != src_ip]", first.changed, b"")
if not resp.ok:
return (StunNatType.CHANGED_ADDR_ERROR, resp)