新增stun服务

This commit is contained in:
zyj
2025-09-02 16:15:08 +08:00
parent 7371d04216
commit 68e606263b
4 changed files with 144 additions and 0 deletions

View File

@@ -25,6 +25,13 @@ func main() {
go handleShutdownSignals()
libs.Connect()
grpcClient.UserClientInit()
// 创建 STUN 服务器实例
stunServer := libs.NewSTUNServer(appConfig.StunPort)
// 启动 STUN 服务器
if err1 := stunServer.Start(); err1 != nil {
log.Fatalf("Failed to start STUN server: %v", err1)
}
defer stunServer.Close()
app := gin.Default()
router.Init(app)
app.Run(":" + strconv.Itoa(appConfig.Port))