Files
2026-07-28 03:21:34 +08:00

48 lines
1.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
我接下来需要你给我生成代码,严格遵守以下条例:
1. 所有变量、函数,能够自定义命名的地方统统使用帕斯卡命名法(大驼峰,get_power_shell写成GetPowerShell)
2. 不要有多余空行,代码尽量紧凑
3. 不需要写注释,以免占用空间
4. 严格使用工程式 NT+面向对象架构
使用 python 写一个 端口转发程序(client + server)
server 运行时需要指定:
内部数据端口=int
允许的端口范围="int-int"
单个客户端允许指定的最多端口数=int
密钥="xxx"
client 运行时需要指定:
服务器域名="xxx"
服务器端口=int
for i in ...:
转发域名="127.0.0.1"
转发端口=int
目标端口=int
模式=tcp/udp
密钥="xxx"
密钥需要混合时间戳加密
实现目的:
在密钥相同的情况下,通过 服务器域名:服务器端口 将 位于 client 转发域名:转发端口 的内容通过“模式”在 server 上的目标端口呈现
注意我需要完整的DEBUG日志输出,所有的报错需要traceback输出来溯源
注意recv数据长度不一定有4096长,所以接收到多少数据就发多少
而且 server 需要支持多客户端
使用 json 进行配置
单独给我 server.py 和 client.py,不要写 config.py 或别的任何文件。
默认值:
内部数据端口=5000
允许的端口范围="5001-5500"
单个客户端允许指定的最多端口数=5
密钥="07A36AEF1907843"
服务器域名="127.0.0.1"
服务器端口=5000
转发域名="127.0.0.1"
转发端口=5902
目标端口=5500
模式=TCP
密钥="07A36AEF1907843"