Skip to content

Commit 0e61d98

Browse files
adamshiervaniym
authored andcommitted
refactor: Remove old http local http endpoint
1 parent fc44b68 commit 0e61d98

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

web.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func setupRouter() *gin.Engine {
9999
protected.Use(protectedMiddleware())
100100
{
101101
protected.GET("/webrtc/signaling", handleLocalWebRTCSignal)
102-
protected.POST("/webrtc/session", handleWebRTCSession)
103102
protected.POST("/cloud/register", handleCloudRegister)
104103
protected.GET("/cloud/state", handleCloudState)
105104
protected.GET("/device", handleDevice)
@@ -254,37 +253,6 @@ func handleWebRTCSignalWsMessages(wsCon *websocket.Conn, isCloudConnection bool)
254253
}
255254
}
256255

257-
func handleWebRTCSession(c *gin.Context) {
258-
var req WebRTCSessionRequest
259-
260-
if err := c.ShouldBindJSON(&req); err != nil {
261-
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
262-
return
263-
}
264-
265-
session, err := newSession(SessionConfig{})
266-
if err != nil {
267-
c.JSON(http.StatusInternalServerError, gin.H{"error": err})
268-
return
269-
}
270-
271-
sd, err := session.ExchangeOffer(req.Sd)
272-
if err != nil {
273-
c.JSON(http.StatusInternalServerError, gin.H{"error": err})
274-
return
275-
}
276-
if currentSession != nil {
277-
writeJSONRPCEvent("otherSessionConnected", nil, currentSession)
278-
peerConn := currentSession.peerConnection
279-
go func() {
280-
time.Sleep(1 * time.Second)
281-
_ = peerConn.Close()
282-
}()
283-
}
284-
currentSession = session
285-
c.JSON(http.StatusOK, gin.H{"sd": sd})
286-
}
287-
288256
func handleLogin(c *gin.Context) {
289257
if config.LocalAuthMode == "noPassword" {
290258
c.JSON(http.StatusBadRequest, gin.H{"error": "Login is disabled in noPassword mode"})

0 commit comments

Comments
 (0)