微信小程序\推拉流

This commit is contained in:
2025-12-15 21:57:21 +08:00
parent 2fca6e5c43
commit 73c2073cf1
14 changed files with 2545 additions and 421 deletions

View File

@@ -52,6 +52,8 @@ if errorlevel 1 (
exit /b 1
)
:: Build Linux version with timestamp
echo 1. Building version with timestamp...
go build -o "%DIST_DIR%\%PROJECT%-linux-%TIMESTAMP%"
if %errorlevel% neq 0 (
echo.
@@ -68,6 +70,19 @@ if %errorlevel% neq 0 (
exit /b 1
)
:: Build/Overwrite Linux version without timestamp (simple version)
echo 2. Creating/Overwriting simple version (without timestamp)...
if exist "%DIST_DIR%\%PROJECT%-linux" (
echo Overwriting existing simple version...
del /q "%DIST_DIR%\%PROJECT%-linux" 2>nul
)
copy "%DIST_DIR%\%PROJECT%-linux-%TIMESTAMP%" "%DIST_DIR%\%PROJECT%-linux" >nul
if %errorlevel% neq 0 (
echo ERROR: Failed to create simple version
) else (
echo Simple version created/updated: %PROJECT%-linux
)
echo.
echo [4/5] Building Windows version...
set GOOS=windows
@@ -86,8 +101,9 @@ echo [5/5] Build successful!
echo.
echo Output directory: %cd%\%DIST_DIR%\
echo Generated files:
echo 1. %PROJECT%-linux-%TIMESTAMP%
echo 2. %PROJECT%-windows-%TIMESTAMP%.exe
echo 1. %PROJECT%-linux-%TIMESTAMP% (with timestamp, for archiving)
echo 2. %PROJECT%-linux (simple version, always latest)
echo 3. %PROJECT%-windows-%TIMESTAMP%.exe
echo.
:clean_prompt
@@ -108,9 +124,11 @@ echo.
echo Cleaning old build files...
for %%f in ("%DIST_DIR%\%PROJECT%-*") do (
if not "%%~nxf"=="%PROJECT%-linux-%TIMESTAMP%" (
if not "%%~nxf"=="%PROJECT%-windows-%TIMESTAMP%.exe" (
echo Deleting: %%f
del /q "%%f"
if not "%%~nxf"=="%PROJECT%-linux" (
if not "%%~nxf"=="%PROJECT%-windows-%TIMESTAMP%.exe" (
echo Deleting: %%f
del /q "%%f"
)
)
)
)
@@ -120,7 +138,8 @@ goto :eof
:run_instructions
echo.
echo Run instructions:
echo Linux: .\%DIST_DIR%\%PROJECT%-linux-%TIMESTAMP% --nodeId=node1 --port=12081
echo Linux (simple version): .\%DIST_DIR%\%PROJECT%-linux --nodeId=node1 --port=12081
echo Linux (with timestamp): .\%DIST_DIR%\%PROJECT%-linux-%TIMESTAMP% --nodeId=node1 --port=12081
echo Windows: .\%DIST_DIR%\%PROJECT%-windows-%TIMESTAMP%.exe --nodeId=win1 --port=12080
echo.

View File

@@ -310,6 +310,10 @@ func main() {
}
})
// WebSocket 推流路由(不经过 authGroup避免中间件干扰 WebSocket 升级)
// 路径GET /api/call/ws-push?stream_id=xxx&user_id=xxx&room_id=xxx&token=xxx
r.GET("/api/call/ws-push", api.WSPushHandler)
// 步骤9: 注册HTTP API路由
apiGroup := r.Group("/api")
{