From 6cc66435f65ed889c10d57720e30a504421d681d Mon Sep 17 00:00:00 2001 From: MatrixSeven Date: Tue, 5 Aug 2025 14:26:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0README=E5=92=8CHero?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0GitHub=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E4=BC=98=E5=8C=96WebRTC=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++-- chuan-next/src/components/Hero.tsx | 27 +++++++++++++++++-- .../src/hooks/webrtc/useWebRTCConnection.ts | 10 +++---- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ad6f6c3..7644417 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # 文件快传 - P2P文件传输工具 + +### 在线体验 https://transfer.52python.cn + ![项目演示](img.png) > 安全、快速、简单的点对点文件传输解决方案 - 无需注册,即传即用 + ## ✨ 核心功能 - 📁 **文件传输** - 支持多文件同时传输,基于WebRTC的P2P直连 @@ -11,7 +15,7 @@ - 🖥️ **桌面共享** - 实时屏幕共享(开发中) - 🔒 **端到端加密** - 数据传输安全,服务器不存储文件 - 📱 **响应式设计** - 完美适配手机、平板、电脑 - +- 🖥️ **多平台支持** - 支持linux/macos/win 单文件部署 ## 🚀 技术栈 **前端** - Next.js 15 + React 18 + TypeScript + Tailwind CSS @@ -23,7 +27,8 @@ ```bash git clone https://github.com/MatrixSeven/file-transfer-go.git cd file-transfer-go -docker-compose up -d +./build-fullstack.sh +./dist/file-transfer-go ``` 访问 http://localhost:8080 开始使用 diff --git a/chuan-next/src/components/Hero.tsx b/chuan-next/src/components/Hero.tsx index 159aa6b..5a4e6c1 100644 --- a/chuan-next/src/components/Hero.tsx +++ b/chuan-next/src/components/Hero.tsx @@ -1,6 +1,7 @@ "use client"; import React from 'react'; +import { Github } from 'lucide-react'; export default function Hero() { return ( @@ -11,11 +12,33 @@ export default function Hero() {

安全、快速、简单的传输服务
- 支持文件、文字、桌面共享 - 无需注册,即传即用 + 基于WebRTC的端到端服务 - 无需注册,即传即用

+ {/* GitHub开源链接 */} +
+ + + 开源项目 + + | + + https://github.com/MatrixSeven/file-transfer-go + +
+ {/* 分割线 */} -
+
); } diff --git a/chuan-next/src/hooks/webrtc/useWebRTCConnection.ts b/chuan-next/src/hooks/webrtc/useWebRTCConnection.ts index 4d9c22d..72fe06e 100644 --- a/chuan-next/src/hooks/webrtc/useWebRTCConnection.ts +++ b/chuan-next/src/hooks/webrtc/useWebRTCConnection.ts @@ -55,12 +55,10 @@ export function useWebRTCConnection() { const STUN_SERVERS = [ // Edge 浏览器专用优化配置 + { urls: 'stun:stun.miwifi.com' }, + { urls: 'stun:stun.chat.bilibili.com' }, + { urls: 'stun:turn.cloudflare.com:3478' }, { urls: 'stun:stun.l.google.com:19302' }, - { urls: 'stun:stun1.l.google.com:19302' }, - { urls: 'stun:stun2.l.google.com:19302' }, - { urls: 'stun:stun3.l.google.com:19302' }, - { urls: 'stun:stun4.l.google.com:19302' }, - // 备用 STUN 服务器 { urls: 'stun:stun.nextcloud.com:443' }, { urls: 'stun:stun.sipgate.net:10000' }, @@ -69,7 +67,7 @@ export function useWebRTCConnection() { // 获取浏览器特定的 RTCConfiguration const getBrowserSpecificConfig = useCallback(() => { - const { isEdge, isSafari, isChromeFamily } = detectBrowser(); + const { isSafari, isChromeFamily } = detectBrowser(); const baseConfig = { iceServers: STUN_SERVERS,