From c86fd099eea3baa9e2c78e1e5eeedf8cb71c3d60 Mon Sep 17 00:00:00 2001 From: backuppc Date: Mon, 19 Jan 2026 14:13:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.tsx | 63 +----------------- .../webftp-backend.exe | Bin 2 files changed, 3 insertions(+), 60 deletions(-) rename webftp-backend.exe => public/webftp-backend.exe (100%) diff --git a/App.tsx b/App.tsx index c3b0ad7..ba1aea8 100644 --- a/App.tsx +++ b/App.tsx @@ -323,73 +323,16 @@ const App: React.FC = () => { // --- Backend Download Logic --- const handleDownloadBackend = () => { - const backendCode = `/** - * WebZilla 백엔드 프록시 서버 (Node.js) v1.2 - * - * 기능: - * - WebSocket Proxy (Port: 8090) - * - FTP/SFTP 지원 - * - 로컬 파일 시스템 탐색 (LOCAL_LIST) - * - 설정 저장 (AppData) - * - 포트 충돌 자동 감지 - */ - -const WebSocket = require('ws'); -const ftp = require('basic-ftp'); -const SftpClient = require('ssh2-sftp-client'); -const fs = require('fs'); -const path = require('path'); -const os = require('os'); -const { exec } = require('child_process'); -const readline = require('readline'); - -function getConfigDir() { - const homedir = os.homedir(); - if (process.platform === 'win32') return path.join(process.env.APPDATA || path.join(homedir, 'AppData', 'Roaming'), 'WebZilla'); - else return path.join(homedir, '.config', 'webzilla'); -} -const configDir = getConfigDir(); -if (!fs.existsSync(configDir)) try { fs.mkdirSync(configDir, { recursive: true }); } catch (e) {} - -const PORT = 8090; - -function startServer() { - const wss = new WebSocket.Server({ port: PORT }); - wss.on('error', (err) => { - if (err.code === 'EADDRINUSE') { - console.error(\`\\n❌ 포트 \${PORT} 사용 중. 자동 해결 시도...\`); - handlePortConflict(); - } else process.exit(1); - }); - wss.on('listening', () => console.log(\`🚀 Server running on ws://localhost:\${PORT}\`)); - wss.on('connection', (ws) => { - let ftpClient = new ftp.Client(); - let sftpClient = new SftpClient(); - ws.on('message', async (message) => { - // ... (Full implementation logic assumed for brevity in this download snippet, - // but user executes the actual file on their disk usually. - // This download is for distribution.) - }); - }); -} -function handlePortConflict() { - // Simplified conflict handler for the downloadable single file - console.log("포트 충돌 감지됨. 기존 프로세스를 종료하세요."); -} -startServer(); -`; - const blob = new Blob([backendCode], { type: 'text/javascript' }); - const url = URL.createObjectURL(blob); + addLog('info', '백엔드 실행 파일 다운로드를 시작합니다...'); const a = document.createElement('a'); - a.href = url; + a.href = './webftp-backend.exe'; a.download = 'webftp-backend.exe'; document.body.appendChild(a); a.click(); document.body.removeChild(a); - URL.revokeObjectURL(url); - addLog('info', '업데이트된 백엔드 코드가 다운로드되었습니다.'); }; + // --- Connection Handlers --- const handleConnect = () => { if (connection.connected) { diff --git a/webftp-backend.exe b/public/webftp-backend.exe similarity index 100% rename from webftp-backend.exe rename to public/webftp-backend.exe