From 44650eb0321f9e511b6ab149abbeb190cce8f61f Mon Sep 17 00:00:00 2001 From: xdzqyyds <139134069+xdzqyyds@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:13:21 +0800 Subject: [PATCH] tokn removed --- server/api/api.go | 7 ++++--- webapp/components/use/whip.ts | 4 ++-- webapp/lib/api.ts | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/api/api.go b/server/api/api.go index 0ae6910..5087c13 100644 --- a/server/api/api.go +++ b/server/api/api.go @@ -6,7 +6,7 @@ import ( "net/url" woomMiddleware "woom/server/api/middleware" - v1 "woom/server/api/v1" + "woom/server/api/v1" "woom/server/helper" "woom/static" @@ -49,8 +49,6 @@ func NewApi(rdb *redis.Client, secret string, live777Url string, live777Token st r.Post("/room/{roomId}/stream", handle.CreateRoomStream) r.Patch("/room/{roomId}/stream/{streamId}", handle.UpdateRoomStream) r.Delete("/room/{roomId}/stream/{streamId}", handle.DestroyRoomStream) - r.HandleFunc("/whip/{uuid}", handler(proxy, live777Url, live777Token)) - r.HandleFunc("/whep/{uuid}", handler(proxy, live777Url, live777Token)) }) r.Post("/user/", handle.CreateUser) @@ -58,6 +56,9 @@ func NewApi(rdb *redis.Client, secret string, live777Url string, live777Token st //r.Post("/room/{roomId}/message", handle.CreateMessage) //r.Get("/room/{roomId}/message", handle.ShowMessage) + r.HandleFunc("/whip/{uuid}", handler(proxy, live777Url, live777Token)) + r.HandleFunc("/whep/{uuid}", handler(proxy, live777Url, live777Token)) + r.Handle("/*", http.StripPrefix("/", http.FileServer(helper.NewSinglePageApp("index.html", http.FS(static.Dist))))) return r } diff --git a/webapp/components/use/whip.ts b/webapp/components/use/whip.ts index abb2312..d63b8db 100644 --- a/webapp/components/use/whip.ts +++ b/webapp/components/use/whip.ts @@ -1,6 +1,6 @@ import { useSyncExternalStore } from 'react' import { event, Context, Data } from './whxp' -import { Stream, StreamState, token } from '../../lib/api' +import { Stream, StreamState } from '../../lib/api' import { WHIPClient } from 'whip-whep/whip' import { deviceNone, @@ -188,7 +188,7 @@ class WHIPContext extends Context { try { const url = location.origin + `/whip/${id}` - await client.publish(pc, url, token) + await client.publish(pc, url) } catch (e) { console.log(e) userStatus.state = StreamState.Failed diff --git a/webapp/lib/api.ts b/webapp/lib/api.ts index 78bf21a..6927ce5 100644 --- a/webapp/lib/api.ts +++ b/webapp/lib/api.ts @@ -133,8 +133,6 @@ export { delStream, StreamState, - - token, } export type {