主 题:求助python调用wintun.dll监听端口问题
发 布 者:lxz07
标签分类: 技术
时 间:2026-09-07 11:25:25
内容预览:我正在用 python wintun 写一个给自己用的梯子客户端,遇到了点问题用 wintun 启动网卡后大约要3s才能监听地址,但是我之前用cpp实现相同的功能没有这个延迟的,这严重影响了它的使用体验,有没有大佬可以i帮我解决一下这个问题,感谢彦祖亦菲运行结果如下D:\file\python\nat-test%26gt%3buv run main.pynetsh interface ipv4 set address name=OneTun static 10.68.0.1 255.255.255.0[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。(重复29次)success bind after 29 try运行方法如下https://www.wintun.net/builds/wintun-0.14.1.zip 解压,把 wintun.dll 放到运行目录管理员运行 uv run main.py / python main.py代码如下from ctypes import WinDLL, wintypesimport ctypesfrom pathlib import Pathimport socketimport subprocessimport timeTUN_IP = "10.68.0.1"TUN_NAME = "OneTun"TUN_TYPE = "WinTun"def run_command(command: list[str]) -%26gt%3b bool: print(" ".join(command)) return subprocess.run(comm
直达链接: https://www.nodeseek.com/post-915929-1
发 布 者:lxz07
标签分类: 技术
时 间:2026-09-07 11:25:25
内容预览:我正在用 python wintun 写一个给自己用的梯子客户端,遇到了点问题用 wintun 启动网卡后大约要3s才能监听地址,但是我之前用cpp实现相同的功能没有这个延迟的,这严重影响了它的使用体验,有没有大佬可以i帮我解决一下这个问题,感谢彦祖亦菲运行结果如下D:\file\python\nat-test%26gt%3buv run main.pynetsh interface ipv4 set address name=OneTun static 10.68.0.1 255.255.255.0[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。[WinError 10049] 在其上下文中,该请求的地址无效。(重复29次)success bind after 29 try运行方法如下https://www.wintun.net/builds/wintun-0.14.1.zip 解压,把 wintun.dll 放到运行目录管理员运行 uv run main.py / python main.py代码如下from ctypes import WinDLL, wintypesimport ctypesfrom pathlib import Pathimport socketimport subprocessimport timeTUN_IP = "10.68.0.1"TUN_NAME = "OneTun"TUN_TYPE = "WinTun"def run_command(command: list[str]) -%26gt%3b bool: print(" ".join(command)) return subprocess.run(comm
直达链接: https://www.nodeseek.com/post-915929-1