1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Live: Support follow client protocol for edge.

This commit is contained in:
winlin 2020-12-24 18:59:29 +08:00
parent 33fa43c118
commit 35431749c4
7 changed files with 57 additions and 2 deletions

View file

@ -1578,6 +1578,8 @@ SrsRequest::SrsRequest()
duration = -1;
port = SRS_CONSTS_RTMP_DEFAULT_PORT;
args = NULL;
protocol = "rtmp";
}
SrsRequest::~SrsRequest()
@ -1605,6 +1607,8 @@ SrsRequest* SrsRequest::copy()
if (args) {
cp->args = args->copy()->to_object();
}
cp->protocol = protocol;
return cp;
}
@ -1632,6 +1636,8 @@ void SrsRequest::update_auth(SrsRequest* req)
if (req->args) {
args = req->args->copy()->to_object();
}
protocol = req->protocol;
srs_info("update req of soruce for auth ok");
}

View file

@ -489,6 +489,12 @@ public:
public:
// Transform it as HTTP request.
virtual SrsRequest* as_http();
public:
// The protocol of client:
// rtmp, Adobe RTMP protocol.
// flv, HTTP-FLV protocol.
// flvs, HTTPS-FLV protocol.
std::string protocol;
};
// The response to client.

View file

@ -680,6 +680,9 @@ SrsRequest* SrsHttpMessage::to_request(string vhost)
if (!oip.empty()) {
req->ip = oip;
}
// The request streaming protocol.
req->protocol = (schema_ == "http")? "flv" : "flvs";
return req;
}