mirror of
https://github.com/IS1DI/x0gp.git
synced 2026-07-16 20:47:55 +00:00
Add WebRTC support and remove deviceId from apis
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
Reference in New Issue
Block a user