diff --git a/kodcloud.ini b/kodcloud.ini index 7a6aeda..6d46af7 100644 --- a/kodcloud.ini +++ b/kodcloud.ini @@ -4,7 +4,7 @@ server_addr = 47.97.6.201 server_port = 7100 token = ENbOUMvXJGWuA623@@@ -[kodcloud_20250911_090516] +[kodcloud_20250929_120753] type = xtcp role = visitor server_name = M0BUnkgzPxR0Ebdp9NQ4VUtm4EpTDvPR1 diff --git a/main.py b/main.py index 7e21e42..e825230 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,114 @@ import qrcode from PIL import Image, ImageTk import io from subprocess import CREATE_NO_WINDOW, STARTUPINFO, STARTF_USESHOWWINDOW +import socket +import json + +class CloudHeartbeatManager: + """网盘加速心跳管理器(基于现有服务)""" + def __init__(self, output_callback, interval=30): + self.interval = interval # 心跳间隔(秒) + self.is_running = False + self.heartbeat_thread = None + self.output_callback = output_callback + self.heartbeat_count = 0 + + def start(self): + """启动心跳""" + if not self.is_running: + self.is_running = True + self.heartbeat_count = 0 + self.heartbeat_thread = threading.Thread(target=self._heartbeat_loop, daemon=True) + self.heartbeat_thread.start() + self.output_callback("[心跳] 开始发送服务心跳...\n") + + def stop(self): + """停止心跳""" + if self.is_running: + self.is_running = False + if self.heartbeat_thread and self.heartbeat_thread.is_alive(): + self.heartbeat_thread.join(timeout=2) + self.output_callback(f"[心跳] 停止服务心跳,共发送 {self.heartbeat_count} 次心跳\n") + + def _heartbeat_loop(self): + """心跳循环""" + while self.is_running: + try: + self._send_heartbeat() + self.heartbeat_count += 1 + + # 等待下一次心跳 + for i in range(self.interval): + if not self.is_running: + break + time.sleep(1) + + except Exception as e: + self.output_callback(f"[心跳] 发送错误: {e}\n") + time.sleep(10) # 出错后等待10秒再重试 + + def _send_heartbeat(self): + """发送心跳包""" + try: + # 获取本机信息 + current_time = time.strftime("%Y-%m-%d %H:%M:%S") + + # 构造心跳数据 + heartbeat_data = { + "type": "cloud_accel_heartbeat", + "timestamp": time.time(), + "time_str": current_time, + "service": "kodcloud_accel", + "status": "running", + "local_ip": "127.0.0.1", + "port": 8088, + "count": self.heartbeat_count + } + + # 通过HTTP发送心跳到本地服务 + self._send_http_heartbeat("127.0.0.1", heartbeat_data) + + # 显示心跳信息 + if self.heartbeat_count % 5 == 0: # 每5次显示一次详细信息 + status_msg = f"[心跳] #{self.heartbeat_count} 服务活跃 - 时间: {current_time}\n" + else: + status_msg = f"[心跳] #{self.heartbeat_count} 服务心跳\n" + + self.output_callback(status_msg) + + except Exception as e: + self.output_callback(f"[心跳] 发送心跳包失败: {e}\n") + + def _send_http_heartbeat(self, local_ip, data): + """通过HTTP发送心跳到本地服务""" + try: + import urllib.request + import json + + # 发送HTTP请求到本地服务 + url = f"http://{local_ip}:8088" + headers = { + 'User-Agent': 'CloudAccel-Heartbeat/1.0', + 'Content-Type': 'application/json', + 'X-Heartbeat': 'true' + } + + # 创建请求 + req = urllib.request.Request( + url, + data=json.dumps(data).encode('utf-8'), + headers=headers, + method='POST' + ) + + # 发送请求(设置较短超时时间) + response = urllib.request.urlopen(req, timeout=5) + response.read() # 读取响应 + + except Exception as e: + # 其他异常忽略 + pass + class FileTransferApp: def __init__(self, root): @@ -45,43 +153,46 @@ class FileTransferApp: } } self.current_page = None + + # 网盘加速心跳管理器 + self.cloud_heartbeat_manager = None # 设置样式 self.setup_styles() - + # 创建主框架容器 self.main_frame = tk.Frame(self.root, bg='white') self.main_frame.pack(fill='both', expand=True, padx=20, pady=20) - + # 显示欢迎界面 self.show_welcome_screen() def save_current_page_state(self): """保存当前页面的状态""" - if self.current_page == 'send': + if self.current_page == 'send' and hasattr(self, 'send_output'): self.page_states['send']['key_entry_text'] = self.send_key_entry.get() self.page_states['send']['file_path'] = self.file_path_var.get() self.page_states['send']['output_content'] = self.send_output.get(1.0, tk.END) - elif self.current_page == 'receive': + elif self.current_page == 'receive' and hasattr(self, 'receive_output'): self.page_states['receive']['key_entry_text'] = self.receive_key_entry.get() self.page_states['receive']['save_path'] = self.receive_path_var.get() self.page_states['receive']['output_content'] = self.receive_output.get(1.0, tk.END) - - elif self.current_page == 'cloud': + elif self.current_page == 'cloud' and hasattr(self, 'cloud_output'): self.page_states['cloud']['output_content'] = self.cloud_output.get(1.0, tk.END) + def restore_page_state(self, page_name): """恢复指定页面的状态""" state = self.page_states[page_name] - if page_name == 'send': + if page_name == 'send' and hasattr(self, 'send_key_entry'): self.send_key_entry.delete(0, tk.END) self.send_key_entry.insert(0, state['key_entry_text']) self.file_path_var.set(state['file_path']) - - self.send_output.config(state='normal') - self.send_output.delete(1.0, tk.END) - self.send_output.insert(1.0, state['output_content']) - self.send_output.config(state='disabled') + if hasattr(self, 'send_output'): + self.send_output.config(state='normal') + self.send_output.delete(1.0, tk.END) + self.send_output.insert(1.0, state['output_content']) + self.send_output.config(state='disabled') # 恢复按钮状态 if state['is_running']: @@ -95,15 +206,15 @@ class FileTransferApp: self.update_send_status("运行中" if state['is_running'] else "等待连接") - elif page_name == 'receive': + elif page_name == 'receive' and hasattr(self, 'receive_key_entry'): self.receive_key_entry.delete(0, tk.END) self.receive_key_entry.insert(0, state['key_entry_text']) self.receive_path_var.set(state['save_path']) - - self.receive_output.config(state='normal') - self.receive_output.delete(1.0, tk.END) - self.receive_output.insert(1.0, state['output_content']) - self.receive_output.config(state='disabled') + if hasattr(self, 'receive_output'): + self.receive_output.config(state='normal') + self.receive_output.delete(1.0, tk.END) + self.receive_output.insert(1.0, state['output_content']) + self.receive_output.config(state='disabled') # 恢复按钮状态 if state['is_running']: @@ -115,7 +226,7 @@ class FileTransferApp: self.update_status("运行中" if state['is_running'] else "等待连接") - elif page_name == 'cloud': + elif page_name == 'cloud' and hasattr(self, 'cloud_output'): self.cloud_output.config(state='normal') self.cloud_output.delete(1.0, tk.END) self.cloud_output.insert(1.0, state['output_content']) @@ -139,7 +250,7 @@ class FileTransferApp: style.configure('Success.TButton', background='#2ecc71', foreground='white') style.configure('Danger.TButton', background='#e74c3c', foreground='white') style.configure('Secondary.TButton', background='#95a5a6', foreground='white') - + def clear_frame(self): """清除当前框架中的所有控件""" for widget in self.main_frame.winfo_children(): @@ -245,21 +356,21 @@ class FileTransferApp: self.save_current_page_state() self.clear_frame() self.current_page = 'welcome' - + # 顶部logo区域 logo_frame = tk.Frame(self.main_frame, bg='white') logo_frame.pack(pady=(30, 20)) - + # 欢迎标签 welcome_label = tk.Label( - logo_frame, + logo_frame, text="🐌 欢迎来到蜗牛创造的高速世界", font=("Microsoft YaHei", 20, "bold"), fg="#2c3e50", bg='white' ) welcome_label.pack() - + # 副标题 subtitle_label = tk.Label( logo_frame, @@ -269,24 +380,24 @@ class FileTransferApp: bg='white' ) subtitle_label.pack(pady=(5, 30)) - + # 功能卡片框架 card_frame = tk.Frame(self.main_frame, bg='white') card_frame.pack(pady=20) - + # 发送卡片 send_card = tk.Frame(card_frame, bg='#f8f9fa', relief='raised', bd=1, padx=20, pady=20) send_card.pack(side='left', padx=15) - + send_icon = tk.Label(send_card, text="📤", font=("Arial", 24), bg='#f8f9fa') send_icon.pack() - + send_title = tk.Label(send_card, text="发送文件", font=("Microsoft YaHei", 14, "bold"), fg="#2c3e50", bg='#f8f9fa') send_title.pack(pady=(10, 5)) - + send_desc = tk.Label(send_card, text="快速安全地发送文件", font=("Microsoft YaHei", 9), fg="#7f8c8d", bg='#f8f9fa') send_desc.pack(pady=(0, 15)) - + send_button = tk.Button( send_card, text="开始发送", @@ -300,20 +411,20 @@ class FileTransferApp: cursor='hand2' ) send_button.pack() - + # 接收卡片 receive_card = tk.Frame(card_frame, bg='#f8f9fa', relief='raised', bd=1, padx=20, pady=20) receive_card.pack(side='left', padx=15) - + receive_icon = tk.Label(receive_card, text="📥", font=("Arial", 24), bg='#f8f9fa') receive_icon.pack() - + receive_title = tk.Label(receive_card, text="接收文件", font=("Microsoft YaHei", 14, "bold"), fg="#2c3e50", bg='#f8f9fa') receive_title.pack(pady=(10, 5)) - + receive_desc = tk.Label(receive_card, text="安全可靠地接收文件", font=("Microsoft YaHei", 9), fg="#7f8c8d", bg='#f8f9fa') receive_desc.pack(pady=(0, 15)) - + receive_button = tk.Button( receive_card, text="开始接收", @@ -372,7 +483,7 @@ class FileTransferApp: # 底部信息 footer_frame = tk.Frame(self.main_frame, bg='white') footer_frame.pack(side='bottom', pady=20) - + footer_label = tk.Label( footer_frame, text="© 2025 蜗牛创造 - 让文件传输更简单", @@ -633,6 +744,7 @@ bind_port = 8089 self.append_cloud_output(f"[监控] 输出监控错误: {e}\n") finally: # 停止nginx服务(如果正在运行) + self.stop_cloud_heartbeat() self.stop_nginx_service() def stop_nginx_service(self): @@ -658,15 +770,15 @@ bind_port = 8089 def start_cloud_accel(self): """启动网盘加速服务""" bport = 8089 - # 检查6000端口是否被占用 + # 检查端口是否被占用 occupying_pids = self.get_processes_using_port(bport) if occupying_pids: - self.append_send_output(f"[警告] {bport}端口被以下进程占用:\n") + self.append_cloud_output(f"[警告] {bport}端口被占用请手动关闭以下进程或等待大约30s后重试启动加速服务:\n") for pid, process_name in occupying_pids: - self.append_send_output(f" - PID: {pid}, 进程: {process_name}\n") - self.append_send_output("[提示] 请手动关闭这些进程或更改端口配置后再试\n") + self.append_cloud_output(f"PID: {pid};进程: {process_name} \n") return + try: # 重置开始时间 self.cloud_start_time = None @@ -702,6 +814,12 @@ bind_port = 8089 creationflags=subprocess.CREATE_NO_WINDOW # 不创建窗口 ) + # 等待服务启动 + time.sleep(3) + + # 启动心跳 + self.start_cloud_heartbeat() + # 更新状态 self.is_cloud_running = True self.cloud_start_button.config(state='disabled') @@ -750,6 +868,8 @@ bind_port = 8089 # 停止nginx服务 self.stop_nginx_service() time.sleep(1) + self.stop_cloud_heartbeat() + time.sleep(1) # 记录结束时间(只有在成功启动过的情况下) if self.cloud_start_time is not None: @@ -773,7 +893,7 @@ bind_port = 8089 self.page_states['cloud']['is_running'] = False # 重置开始时间 self.cloud_start_time = None - + time.sleep(1) def append_cloud_output(self, message): """向网盘加速输出框添加消息""" @@ -820,14 +940,14 @@ bind_port = 8089 self.save_current_page_state() self.clear_frame() self.current_page = 'send' - + # 标题栏 title_frame = tk.Frame(self.main_frame, bg='white') title_frame.pack(fill='x', pady=(10, 20)) - + back_button = self.create_styled_button(title_frame, "← 返回", self.show_welcome_screen, "#95a5a6", 8) back_button.pack(side='left') - + title_label = tk.Label( title_frame, text="📤 文件发送", @@ -836,51 +956,51 @@ bind_port = 8089 bg='white' ) title_label.pack(side='left', padx=10) - + # 输入卡片 input_card = tk.Frame(self.main_frame, bg='#f8f9fa', relief='raised', bd=1, padx=20, pady=20) input_card.pack(fill='x', pady=(0, 15)) - + # 密钥输入 key_frame = tk.Frame(input_card, bg='#f8f9fa') key_frame.pack(fill='x', pady=5) - + tk.Label(key_frame, text="🔑 密钥:", font=("Microsoft YaHei", 10), bg='#f8f9fa').pack(side='left') self.send_key_entry = tk.Entry(key_frame, font=("Microsoft YaHei", 10), width=40, relief='solid', bd=1) self.send_key_entry.pack(side='left', padx=10) - + # 文件选择 file_frame = tk.Frame(input_card, bg='#f8f9fa') file_frame.pack(fill='x', pady=10) - + tk.Label(file_frame, text="📁 文件路径:", font=("Microsoft YaHei", 10), bg='#f8f9fa').pack(side='left') self.file_path_var = tk.StringVar() - file_entry = tk.Entry(file_frame, textvariable=self.file_path_var, font=("Microsoft YaHei", 10), + file_entry = tk.Entry(file_frame, textvariable=self.file_path_var, font=("Microsoft YaHei", 10), width=30, state='readonly', relief='solid', bd=1) file_entry.pack(side='left', padx=10) - + browse_button = self.create_styled_button(file_frame, "浏览文件", self.browse_file, "#8e44ad", 10) browse_button.pack(side='left') - + # 按钮组 button_frame = tk.Frame(self.main_frame, bg='white') button_frame.pack(pady=15) - + self.send_connect_button = self.create_styled_button(button_frame, "🔄 连接", self.start_send_connection, "#27ae60") self.send_connect_button.pack(side='left', padx=5) - + self.send_file_button = self.create_styled_button(button_frame, "🚀 发送文件", self.start_file_send, "#e74c3c") self.send_file_button.pack(side='left', padx=5) self.send_file_button.config(state='disabled') - + self.send_stop_button = self.create_styled_button(button_frame, "⏹️ 停止", self.stop_send_connection, "#95a5a6") self.send_stop_button.pack(side='left', padx=5) self.send_stop_button.config(state='disabled') - + # 状态显示 status_frame = tk.Frame(self.main_frame, bg='white') status_frame.pack(fill='x', pady=5) - + self.send_status_label = tk.Label( status_frame, text="📊 状态: 等待连接", @@ -889,14 +1009,14 @@ bind_port = 8089 bg='white' ) self.send_status_label.pack() - + # 输出区域 output_card = tk.Frame(self.main_frame, bg='#f8f9fa', relief='raised', bd=1, padx=15, pady=15) output_card.pack(fill='both', expand=True, pady=(10, 0)) - + output_label = tk.Label(output_card, text="📋 发送日志:", font=("Microsoft YaHei", 10), bg='#f8f9fa') output_label.pack(anchor='w') - + self.send_output = scrolledtext.ScrolledText( output_card, height=12, @@ -908,11 +1028,11 @@ bind_port = 8089 bg='#ffffff' ) self.send_output.pack(fill='both', expand=True, pady=(5, 0)) - + # 初始信息 self.append_send_output("等待输入密钥并选择文件...\n") self.append_send_output("密钥格式应为: token|sk|psk|sern\n") - + # 进程引用 self.send_frpc_process = None self.send_p2p_process = None @@ -948,15 +1068,15 @@ bind_port = 8089 self.save_current_page_state() self.clear_frame() self.current_page = 'receive' - + # 标题栏 title_frame = tk.Frame(self.main_frame, bg='white') title_frame.pack(fill='x', pady=(10, 20)) - + back_button = self.create_styled_button(title_frame, "← 返回", self.show_welcome_screen, "#95a5a6", 8) back_button.pack(side='left') - + title_label = tk.Label( title_frame, text="📥 文件接收", @@ -965,48 +1085,48 @@ bind_port = 8089 bg='white' ) title_label.pack(side='left', padx=10) - + # 输入卡片 input_card = tk.Frame(self.main_frame, bg='#f8f9fa', relief='raised', bd=1, padx=20, pady=20) input_card.pack(fill='x', pady=(0, 15)) - + # 密钥输入 key_frame = tk.Frame(input_card, bg='#f8f9fa') key_frame.pack(fill='x', pady=5) - + tk.Label(key_frame, text="🔑 密钥:", font=("Microsoft YaHei", 10), bg='#f8f9fa').pack(side='left') self.receive_key_entry = tk.Entry(key_frame, font=("Microsoft YaHei", 10), width=40, relief='solid', bd=1) self.receive_key_entry.pack(side='left', padx=10) - + # 保存路径选择 path_frame = tk.Frame(input_card, bg='#f8f9fa') path_frame.pack(fill='x', pady=10) - + tk.Label(path_frame, text="💾 保存路径:", font=("Microsoft YaHei", 10), bg='#f8f9fa').pack(side='left') self.receive_path_var = tk.StringVar() self.receive_path_var.set(".\\received_files") # 默认路径 - path_entry = tk.Entry(path_frame, textvariable=self.receive_path_var, font=("Microsoft YaHei", 10), + path_entry = tk.Entry(path_frame, textvariable=self.receive_path_var, font=("Microsoft YaHei", 10), width=30, relief='solid', bd=1) path_entry.pack(side='left', padx=10) - + browse_path_button = self.create_styled_button(path_frame, "浏览文件夹", self.browse_receive_path, "#8e44ad", 12) browse_path_button.pack(side='left') - + # 按钮组 button_frame = tk.Frame(self.main_frame, bg='white') button_frame.pack(pady=15) - + self.connect_button = self.create_styled_button(button_frame, "🔄 连接", self.start_frpc_connection, "#27ae60") self.connect_button.pack(side='left', padx=5) - + self.stop_button = self.create_styled_button(button_frame, "⏹️ 停止", self.stop_frpc_connection, "#e74c3c") self.stop_button.pack(side='left', padx=5) self.stop_button.config(state='disabled') - + # 状态显示 status_frame = tk.Frame(self.main_frame, bg='white') status_frame.pack(fill='x', pady=5) - + self.status_label = tk.Label( status_frame, text="📊 状态: 等待连接", @@ -1015,14 +1135,14 @@ bind_port = 8089 bg='white' ) self.status_label.pack() - + # 输出区域 output_card = tk.Frame(self.main_frame, bg='#f8f9fa', relief='raised', bd=1, padx=15, pady=15) output_card.pack(fill='both', expand=True, pady=(10, 0)) - + output_label = tk.Label(output_card, text="📋 接收日志:", font=("Microsoft YaHei", 10), bg='#f8f9fa') output_label.pack(anchor='w') - + self.receive_output = scrolledtext.ScrolledText( output_card, height=12, @@ -1034,12 +1154,12 @@ bind_port = 8089 bg='#ffffff' ) self.receive_output.pack(fill='both', expand=True, pady=(5, 0)) - + # 初始信息 self.append_output("等待输入密钥并连接...\n") self.append_output("密钥格式应为: token|sk|psk|sern\n") self.append_output(f"文件将保存到: {self.receive_path_var.get()}\n") - + # 进程引用 self.frpc_process = None self.p2p_process = None @@ -1081,7 +1201,7 @@ bind_port = 8089 if file_path: self.file_path_var.set(file_path) self.append_send_output(f"✅ 已选择文件: {file_path}\n") - + def create_send_ini(self, token, sk, sern, bport): """创建send.ini配置文件""" ini_content = f"""[common] @@ -1107,7 +1227,7 @@ bind_port = {bport} except Exception as e: self.append_send_output(f"创建配置文件失败: {e}\n") return False - + def monitor_send_frpc_output(self): """监控发送NATCC输出""" try: @@ -1118,7 +1238,7 @@ bind_port = {bport} self.append_send_output(f"[NATC] {line}") except: pass - + def monitor_send_p2p_output(self): """监控发送P2P输出""" try: @@ -1148,15 +1268,15 @@ bind_port = {bport} self.append_send_output(f"❌ 文件发送失败,退出码: {return_code}\n") self.send_file_button.config(state='normal') - + except Exception as e: self.append_send_output(f"[P2P] 输出监控错误: {e}\n") - + def execute_send_frpc(self): """执行发送NATCC命令""" try: self.update_send_status("正在启动NATC客户端...") - + self.send_frpc_process = subprocess.Popen( ['.\\gc.exe', '-c', '.\\send.ini'], stdout=subprocess.PIPE, @@ -1173,30 +1293,30 @@ bind_port = {bport} # 启动输出监控线程 output_thread = threading.Thread(target=self.monitor_send_frpc_output, daemon=True) output_thread.start() - + # 等待一段时间让NATCC建立连接 self.append_send_output("[NATC] 等待NATC连接建立...\n") time.sleep(3) - + # 检查NATCC进程是否还在运行 if self.send_frpc_process.poll() is not None: self.append_send_output("[NATC] NATC客户端意外退出\n") return - + # 如果还在运行,启用发送文件按钮 if self.is_send_running: self.append_send_output("[NATC] NATC连接已建立,可以发送文件\n") self.send_file_button.config(state='normal') self.update_send_status("就绪,可以发送文件") - + except Exception as e: self.append_send_output(f"[NATC] 执行错误: {e}\n") - + def execute_send_file(self): """执行文件发送""" try: self.update_send_status("正在发送文件...") - + file_path = self.file_path_var.get() if not file_path or not os.path.exists(file_path): self.append_send_output("[错误] 文件路径无效或文件不存在\n") @@ -1222,8 +1342,8 @@ bind_port = {bport} self.send_p2p_process = subprocess.Popen( [ - '.\\python.exe', - '.\\p2pfile.py', + '.\\python.exe', + '.\\p2pfile.py', '--mode', 'send', '--path', file_path, '--psk', self.send_psk, @@ -1238,33 +1358,33 @@ bind_port = {bport} universal_newlines=True, creationflags=subprocess.CREATE_NO_WINDOW # 不创建窗口 ) - + self.append_send_output(f"[P2P] 开始发送文件: {os.path.basename(file_path)}\n") - + # 启动输出监控线程 output_thread = threading.Thread(target=self.monitor_send_p2p_output, daemon=True) output_thread.start() - + except Exception as e: self.append_send_output(f"[P2P] 执行错误: {e}\n") - + def start_send_connection(self): """开始发送连接""" key = self.send_key_entry.get().strip() if not key: messagebox.showwarning("输入错误", "请输入密钥") return - + # 解析密钥 if '|' not in key: messagebox.showwarning("格式错误", "密钥格式应为: token|sk|psk|sern") return - + parts = key.split('|') if len(parts) < 4: messagebox.showwarning("格式错误", "密钥格式应为: token|sk|psk|sern") return - + token = parts[0].strip() sk = parts[1].strip() psk = parts[2].strip() @@ -1289,12 +1409,12 @@ bind_port = {bport} # 创建配置文件 if not self.create_send_ini(token, sk, sern, bport): return - + # 清空输出框 self.send_output.config(state='normal') self.send_output.delete(1.0, tk.END) self.send_output.config(state='disabled') - + self.append_send_output(f"开始连接流程...\n") self.append_send_output(f"Token: {token}\n") self.append_send_output(f"SK: {sk}\n") @@ -1302,15 +1422,15 @@ bind_port = {bport} self.append_send_output(f"SERN: {sern}\n") self.append_send_output(f"BPORT: {bport}\n") self.append_send_output("-" * 50 + "\n") - + # 禁用连接按钮,启用停止按钮 self.send_connect_button.config(state='disabled') self.send_stop_button.config(state='normal') - + # 设置运行标志 self.is_send_running = True self.update_send_status("启动中...") - + # 在新线程中执行NATCC self.send_process_thread = threading.Thread(target=self.execute_send_frpc, daemon=True) self.send_process_thread.start() @@ -1338,7 +1458,11 @@ bind_port = {bport} # 方法1: 使用netstat命令 result = subprocess.run( ['netstat', '-ano', '-p', 'tcp'], - capture_output=True, text=True, encoding='gbk',creationflags=subprocess.CREATE_NO_WINDOW # 不创建窗口 + capture_output=True, + text=True, + encoding='gbk', + creationflags=subprocess.CREATE_NO_WINDOW, # 不创建窗口 + timeout=10 ) lines = result.stdout.split('\n') @@ -1409,19 +1533,19 @@ bind_port = {bport} if not self.file_path_var.get(): messagebox.showwarning("选择错误", "请先选择要发送的文件") return - + # 禁用发送按钮,避免重复点击 self.send_file_button.config(state='disabled') - + # 在新线程中执行文件发送 send_thread = threading.Thread(target=self.execute_send_file, daemon=True) send_thread.start() - + def stop_send_connection(self): """停止发送连接""" self.is_send_running = False self.update_send_status("正在停止...") - + # 停止NATCC进程 if self.send_frpc_process and self.send_frpc_process.poll() is None: try: @@ -1429,7 +1553,7 @@ bind_port = {bport} self.append_send_output("[NATC] 正在停止NATC客户端...\n") except: pass - + # 停止P2P进程 if self.send_p2p_process and self.send_p2p_process.poll() is None: try: @@ -1437,9 +1561,9 @@ bind_port = {bport} self.append_send_output("[P2P] 正在停止文件发送...\n") except: pass - + time.sleep(1) - + self.send_connect_button.config(state='normal') self.send_file_button.config(state='disabled') self.send_stop_button.config(state='disabled') @@ -1451,7 +1575,7 @@ bind_port = {bport} def update_send_status(self, status): """更新发送状态标签""" self.send_status_label.config(text=f"状态: {status}") - + def append_send_output(self, message): """向发送输出框添加消息""" self.send_output.config(state='normal') @@ -1460,8 +1584,8 @@ bind_port = {bport} self.send_output.config(state='disabled') # 更新状态存储 self.page_states['send']['output_content'] = self.send_output.get(1.0, tk.END) - - + + def create_service_ini(self, token, sk, sern, bport): """创建service.ini配置文件""" ini_content = f"""[common] @@ -1507,21 +1631,21 @@ local_port = {bport} # 启动输出监控线程 output_thread = threading.Thread(target=self.monitor_frpc_output, daemon=True) output_thread.start() - + # 等待一段时间让NATCC建立连接 self.append_output("[NATC] 等待NATC连接建立...\n") time.sleep(3) # 等待3秒让NATCC建立连接 - + # 检查NATCC进程是否还在运行 if self.frpc_process.poll() is not None: self.append_output("[NATC] NATC客户端意外退出\n") return - + # 如果还在运行,启动P2P if self.is_running: self.append_output("[NATC] NATC连接已建立,启动P2P接收器...\n") self.execute_p2p_receiver() - + except Exception as e: self.append_output(f"[NATC] 执行错误: {e}\n") @@ -1535,7 +1659,7 @@ local_port = {bport} self.append_output(f"[NATC] {line}") except: pass - + def monitor_p2p_output(self): """监控P2P输出并检测进程结束""" try: @@ -1563,7 +1687,7 @@ local_port = {bport} self.append_output(f"[时间] 文件接收异常结束: {end_time_str}\n") self.append_output(f"[统计] 运行时间: {duration_str}\n") self.append_output(f"❌ 文件接收失败,退出码: {return_code}\n") - + except Exception as e: self.append_output(f"[P2P] 输出监控错误: {e}\n") @@ -1613,11 +1737,11 @@ local_port = {bport} # 创建目录(如果不存在) os.makedirs(save_path, exist_ok=True) - + self.p2p_process = subprocess.Popen( [ - '.\\python.exe', - '.\\p2pfile.py', + '.\\python.exe', + '.\\p2pfile.py', '--mode', 'recv', '--psk', self.current_psk, '--outdir', save_path, @@ -1637,43 +1761,43 @@ local_port = {bport} self.append_output("[P2P] 启动P2P文件接收器...\n") self.append_output(f"[P2P] 使用PSK: {self.current_psk}\n") self.append_output(f"[P2P] 文件保存路径: {save_path}\n") - + # 启动输出监控线程 output_thread = threading.Thread(target=self.monitor_p2p_output, daemon=True) output_thread.start() - + # 检查进程是否立即失败 time.sleep(1) if self.p2p_process.poll() is not None: self.append_output("[P2P] P2P接收器启动失败\n") - + except Exception as e: self.append_output(f"[P2P] 执行错误: {e}\n") - + def start_frpc_connection(self): """开始NATC连接和P2P接收""" key = self.receive_key_entry.get().strip() if not key: messagebox.showwarning("输入错误", "请输入密钥") return - + # 解析密钥 if '|' not in key: messagebox.showwarning("格式错误", "密钥格式应为: token|sk|psk|sern") return - + parts = key.split('|') if len(parts) < 4: messagebox.showwarning("格式错误", "密钥格式应为: token|sk|psk|sern") return - + token = parts[0].strip() sk = parts[1].strip() psk = parts[2].strip() sern = parts[3].strip() # 修改: 当缺少bport时,默认使用7001 bport = parts[4].strip() if len(parts) > 4 else "6000" - + self.current_token = token self.current_sk = sk self.current_psk = psk @@ -1693,16 +1817,16 @@ local_port = {bport} save_path = self.receive_path_var.get() self.append_output(f"📁 保存路径: {save_path}\n") - + # 创建配置文件 if not self.create_service_ini(token, sk, sern, bport): return - + # 清空输出框 self.receive_output.config(state='normal') self.receive_output.delete(1.0, tk.END) self.receive_output.config(state='disabled') - + self.append_output(f"开始连接流程...\n") self.append_output(f"Token: {token}\n") self.append_output(f"SK: {sk}\n") @@ -1711,15 +1835,15 @@ local_port = {bport} self.append_output(f"保存路径: {save_path}\n") self.append_output(f"port: {bport}\n") self.append_output("-" * 50 + "\n") - + # 禁用连接按钮,启用停止按钮 self.connect_button.config(state='disabled') self.stop_button.config(state='normal') - + # 设置运行标志 self.is_running = True self.update_status("启动中...") - + # 在新线程中执行 self.process_thread = threading.Thread(target=self.execute_frpc, daemon=True) self.process_thread.start() @@ -1728,12 +1852,12 @@ local_port = {bport} self.page_states['receive']['is_running'] = True self.page_states['receive']['key_entry_text'] = key self.page_states['receive']['save_path'] = self.receive_path_var.get() - + def stop_frpc_connection(self): """停止所有进程""" self.is_running = False self.update_status("正在停止...") - + # 停止NATCC进程 if self.frpc_process and self.frpc_process.poll() is None: try: @@ -1741,7 +1865,7 @@ local_port = {bport} self.append_output("[NATC] 正在停止NATC客户端...\n") except: pass - + # 停止P2P进程 if self.p2p_process and self.p2p_process.poll() is None: try: @@ -1749,9 +1873,9 @@ local_port = {bport} self.append_output("[P2P] 正在停止P2P接收器...\n") except: pass - + time.sleep(1) # 给进程一些时间结束 - + self.connect_button.config(state='normal') self.stop_button.config(state='disabled') self.update_status("已停止") @@ -1761,7 +1885,7 @@ local_port = {bport} def update_status(self, status): """更新状态标签""" self.status_label.config(text=f"状态: {status}") - + def append_output(self, message): """向输出框添加消息""" self.receive_output.config(state='normal') @@ -1770,6 +1894,25 @@ local_port = {bport} self.receive_output.config(state='disabled') # 更新状态存储 self.page_states['receive']['output_content'] = self.receive_output.get(1.0, tk.END) + def start_cloud_heartbeat(self): + """启动网盘加速心跳""" + try: + self.cloud_heartbeat_manager = CloudHeartbeatManager(self.append_cloud_output, interval=30) + self.cloud_heartbeat_manager.start() + self.append_cloud_output("[心跳] 🎯 服务心跳已启动,间隔30秒\n") + except Exception as e: + self.append_cloud_output(f"[心跳] 启动失败: {e}\n") + + def stop_cloud_heartbeat(self): + """停止网盘加速心跳""" + try: + if self.cloud_heartbeat_manager: + self.cloud_heartbeat_manager.stop() + self.cloud_heartbeat_manager = None + except Exception as e: + self.append_cloud_output(f"[心跳] 停止失败: {e}\n") + + # 创建主窗口并运行程序 if __name__ == "__main__": diff --git a/ng/logs/access.log b/ng/logs/access.log index 4847f5e..9897e5f 100644 --- a/ng/logs/access.log +++ b/ng/logs/access.log @@ -5041,3 +5041,188 @@ 192.168.1.47 - - [08/Sep/2025:17:57:33 +0800] "POST /index.php?explorer/list/path HTTP/1.1" 200 452 "-" "kodCloud-System=iOS;Device=iPhone 13 Pro;softwareVerison=18.5;AppVersion=2.2.3;Language=zh-Hans" 192.168.1.47 - - [08/Sep/2025:17:57:33 +0800] "POST /index.php?explorer/list/path HTTP/1.1" 200 3112 "-" "kodCloud-System=iOS;Device=iPhone 13 Pro;softwareVerison=18.5;AppVersion=2.2.3;Language=zh-Hans" 192.168.1.47 - - [08/Sep/2025:18:05:32 +0800] "POST /index.php?user/index/accessTokenGet HTTP/1.1" 200 181 "-" "kodCloud-System=iOS;Device=iPhone 13 Pro;softwareVerison=18.5;AppVersion=2.2.3;Language=zh-Hans" +127.0.0.1 - - [29/Sep/2025:09:50:27 +0800] "GET / HTTP/1.1" 200 2528 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:27 +0800] "GET /static/images/common/loading-pin3-dark.gif?v=1.57.01 HTTP/1.1" 200 3897 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:29 +0800] "GET /static/app/vender/es3-profill.js?v=1.57.01 HTTP/1.1" 200 105974 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:32 +0800] "GET /static/style/lib/main.css?v=1.57.01 HTTP/1.1" 200 211640 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:41 +0800] "GET /static/style/dist/main.css?v=1.57.01 HTTP/1.1" 200 667321 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:41 +0800] "GET /static/app/dist/vendor.js?v=1.57.01 HTTP/1.1" 200 679597 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:41 +0800] "GET /static/app/dist/main.js?v=1.57.01 HTTP/1.1" 200 691883 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:42 +0800] "GET /?user/view/manifestJS HTTP/1.1" 200 234 "http://127.0.0.1:8088/?user/view/manifestJS" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:43 +0800] "GET / HTTP/1.1" 200 2528 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:43 +0800] "GET /static/style/dist/main.css?v=1.57.01 HTTP/1.1" 206 1 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:43 +0800] "GET /static/app/dist/main.js?v=1.57.01 HTTP/1.1" 206 1 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:43 +0800] "GET /static/app/dist/vendor.js?v=1.57.01 HTTP/1.1" 206 1 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:47 +0800] "GET /static/app/dist/vendor.js?v=1.57.01 HTTP/1.1" 206 172417 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:55 +0800] "GET /static/style/dist/main.css?v=1.57.01 HTTP/1.1" 206 955695 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:56 +0800] "GET /.well-known/appspecific/com.chrome.devtools.json HTTP/1.1" 404 181 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:56 +0800] "GET /index.php?user/view/manifest HTTP/1.1" 200 674 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:56 +0800] "GET / HTTP/1.1" 200 2528 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:50:59 +0800] "GET /static/app/dist/main.js?v=1.57.01 HTTP/1.1" 206 1769095 "http://127.0.0.1:8088/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:51:01 +0800] "GET /?user/view/manifestJS HTTP/1.1" 200 234 "http://127.0.0.1:8088/?user/view/manifestJS" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" +127.0.0.1 - - [29/Sep/2025:09:56:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:09:57:15 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:09:57:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:00:39 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:01:14 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:01:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:02:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:02:50 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:03:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:03:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:04:21 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:04:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:09:05 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:13:17 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:13:47 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:17:07 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:20:24 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:22:42 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:25:02 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:25:24 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:25:48 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:26:47 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:10:27:22 +0800] "POST / HTTP/1.1" 502 497 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:02:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:06:54 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:07:24 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:09:52 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:14:12 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:19:55 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:20:52 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:21:21 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:24:09 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:26:30 +0800] "POST / HTTP/1.1" 502 497 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:26:48 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:27:06 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:29:16 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:29:48 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:30:18 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:30:48 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:31:19 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:31:49 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:32:19 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:32:49 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:33:19 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:35:41 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:35:59 +0800] "POST / HTTP/1.1" 502 497 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:36:10 +0800] "POST / HTTP/1.1" 502 497 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:36:26 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:39:40 +0800] "POST / HTTP/1.1" 499 0 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:40:10 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:40:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:41:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:41:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:42:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:42:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:43:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:43:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:44:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:44:42 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:45:12 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:11:45:42 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:04:55 +0800] "POST / HTTP/1.1" 502 497 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:05:33 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:08:03 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:08:32 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:09:02 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:09:33 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:10:03 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:10:33 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:11:04 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:11:34 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:12:05 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:12:36 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:13:07 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:13:37 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:14:07 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:14:38 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:15:08 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:15:39 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:16:09 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:16:39 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:17:09 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:17:40 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:18:10 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:18:40 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:19:10 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:19:40 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:20:10 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:20:40 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:21:10 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:21:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:22:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:22:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:23:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:23:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:24:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:24:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:25:11 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:25:41 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:26:12 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:26:42 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:27:12 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:27:42 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:28:12 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:28:42 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:29:13 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:29:43 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:30:13 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:30:43 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:31:14 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:31:44 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:32:14 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:32:44 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:33:15 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:33:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:34:15 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:34:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:35:15 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:35:45 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:36:16 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:36:46 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:37:16 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:37:47 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:38:17 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:38:48 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:39:18 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:39:48 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:40:18 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:40:49 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:41:19 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:41:49 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:42:19 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:42:49 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:43:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:43:50 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:44:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:44:50 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:45:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:45:50 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:46:20 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:46:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:47:21 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:47:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:48:21 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:48:51 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:49:21 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:49:52 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:50:22 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:50:52 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:51:22 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:51:52 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:52:23 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:52:53 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:53:23 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:53:53 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:54:24 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:54:54 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:55:24 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:55:54 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:56:24 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:56:54 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:57:25 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:57:55 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:58:26 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:58:57 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" +127.0.0.1 - - [29/Sep/2025:12:59:27 +0800] "POST / HTTP/1.1" 200 5264 "-" "CloudAccel-Heartbeat/1.0" diff --git a/ng/logs/error.log b/ng/logs/error.log index c5306fd..767f6c0 100644 --- a/ng/logs/error.log +++ b/ng/logs/error.log @@ -943,3 +943,8 @@ 2025/09/08 17:16:33 [error] 63116#59748: *1 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.1.47, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "192.168.1.47:8088" 2025/09/08 17:16:35 [error] 63116#59748: *1 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.1.47, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8089/favicon.ico", host: "192.168.1.47:8088", referrer: "http://192.168.1.47:8088/" 2025/09/08 17:51:05 [error] 56088#41836: *1 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 192.168.1.47, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "192.168.1.47:8088" +2025/09/29 10:27:22 [error] 40664#6364: *3 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "127.0.0.1:8088" +2025/09/29 11:26:30 [error] 40184#20820: *1 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "127.0.0.1:8088" +2025/09/29 11:35:59 [error] 17576#7980: *1 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "127.0.0.1:8088" +2025/09/29 11:36:10 [error] 29392#32336: *1 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "127.0.0.1:8088" +2025/09/29 12:04:55 [error] 31420#39160: *27 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8089/", host: "127.0.0.1:8088" diff --git a/ng/logs/nginx.pid b/ng/logs/nginx.pid index 6bc29e1..0e36479 100644 --- a/ng/logs/nginx.pid +++ b/ng/logs/nginx.pid @@ -1 +1 @@ -70912 +31432