From c96d5500013036cda67379d60308e6e20abedf44 Mon Sep 17 00:00:00 2001 From: kura Date: Fri, 3 Jan 2025 10:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Evoice=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +- package.json | 3 +- src/App.vue | 5 +- src/main.ts | 2 + src/pages/voice/webrtcVoice.vue | 284 ++++++++++++++++++++++++++++++++ src/router/router.ts | 12 ++ yarn.lock | 9 +- 7 files changed, 321 insertions(+), 5 deletions(-) create mode 100644 src/pages/voice/webrtcVoice.vue create mode 100644 src/router/router.ts diff --git a/README.md b/README.md index 5f49eed..7ae9081 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ p2p-explorer-web 是一个基于浏览器的 webtrc P2P 远程文件传输工具 - 🌐 无需安装,基于浏览器即可使用 - 💨 快速分享链接功能 +## 需要注意使用的服务 + +文件交互全部走 webrtc,使用 peerjs 的信令服务器(wss://0.peerjs.com/peerjs)交换 ice 候选(可信,没有本地数据上传),使用 peerjs 的打洞 0.peerjs.com:(可信,没有数据上传),当 udp 直连失败,会使用 peerjs 的中转服务(不可信,所有数据上传),后续会 docker 化,使用自己的 stun 与 turn 自定义部署。 + ## 🚀 快速开始 ### 安装 @@ -56,8 +60,13 @@ cp -r static dist/ ## 待完成 - 本地发送到远程的 ui 展示 -- 屏幕预览 +- 屏幕预览 语音沟通 引用文件文字交流 - docker 化,使用自己的 stun 与 turn 自定义部署 - 各种异常处理需要闭环 - 英文版本 - 打包下载 + +## 感谢 + +[PeerJS](https://peerjs.com/) 提供的 WebRTC 支持 +[Ant Design Vue](https://2x.antdv.com/docs/vue/introduce-cn/) 提供的 UI 支持 diff --git a/package.json b/package.json index 4dcf739..2214059 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "highlight.js": "^11.11.1", "peerjs": "^1.5.4", "vue": "^3.3.0", - "vue-i18n": "^9.1.9" + "vue-i18n": "^9.1.9", + "vue-router": "^4.5.0" }, "devDependencies": { "@rushstack/eslint-patch": "^1.6.1", diff --git a/src/App.vue b/src/App.vue index 8e03d3e..6cbc186 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,10 @@ + + diff --git a/src/router/router.ts b/src/router/router.ts new file mode 100644 index 0000000..afcc862 --- /dev/null +++ b/src/router/router.ts @@ -0,0 +1,12 @@ +import { createRouter, createWebHashHistory } from "vue-router"; +import Index from "../pages/file/index.vue"; +import Voice from "../pages/voice/webrtcVoice.vue"; +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + { path: "/", component: Index }, + { path: "/voice", component: Voice }, + ], +}); + +export default router; diff --git a/yarn.lock b/yarn.lock index bd01971..a33e0a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -581,7 +581,7 @@ "@vue/compiler-dom" "3.5.13" "@vue/shared" "3.5.13" -"@vue/devtools-api@^6.5.0": +"@vue/devtools-api@^6.5.0", "@vue/devtools-api@^6.6.4": version "6.6.4" resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz#cbe97fe0162b365edc1dba80e173f90492535343" integrity sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g== @@ -2102,6 +2102,13 @@ vue-i18n@^9.1.9: "@intlify/shared" "9.14.2" "@vue/devtools-api" "^6.5.0" +vue-router@^4.5.0: + version "4.5.0" + resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.0.tgz#58fc5fe374e10b6018f910328f756c3dae081f14" + integrity sha512-HDuk+PuH5monfNuY+ct49mNmkCRK4xJAV9Ts4z9UFc4rzdDnxQLyCMGGc8pKhZhHTVzfanpNwB/lwqevcBwI4w== + dependencies: + "@vue/devtools-api" "^6.6.4" + vue-template-compiler@^2.7.14: version "2.7.16" resolved "https://registry.npmmirror.com/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz#c81b2d47753264c77ac03b9966a46637482bb03b"