Add WebRTC support and remove deviceId from apis

This commit is contained in:
x0gp
2026-07-15 00:57:36 +04:00
parent 7a7913d2ee
commit c25e0bc581
11 changed files with 1428 additions and 17 deletions
+62
View File
@@ -1846,6 +1846,40 @@ const docTemplate = `{
}
}
},
"/api/webrtc/connect": {
"post": {
"description": "Accepts SDP Offer, negotiates peer connection, and returns SDP Answer. Routes video and control data via DataChannels.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"webrtc"
],
"summary": "Establish WebRTC connection for driver-car 1-to-1 proxying",
"parameters": [
{
"description": "SDP Offer details",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/transport.WebRTCConnectRequest"
}
}
],
"responses": {
"200": {
"description": "SDP Answer negotiation success",
"schema": {
"$ref": "#/definitions/transport.WebRTCConnectResponse"
}
}
}
}
},
"/health": {
"get": {
"description": "Returns 200 OK with current engine phase, WS connection count and total snapshot drops. Intended for load-balancer health checks.",
@@ -2891,6 +2925,34 @@ const docTemplate = `{
"example": "0.1.0-poc"
}
}
},
"transport.WebRTCConnectRequest": {
"type": "object",
"properties": {
"driver_id": {
"type": "string",
"example": "driver-alice"
},
"sdp": {
"type": "string"
},
"type": {
"type": "string",
"example": "offer"
}
}
},
"transport.WebRTCConnectResponse": {
"type": "object",
"properties": {
"sdp": {
"type": "string"
},
"type": {
"type": "string",
"example": "answer"
}
}
}
}
}`