mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Compatible with legacy RTMP URL. v5.0.142. v6.0.27 (#3429)
For compatibility, transform rtmp://ip/app...vhost...VHOST/stream to typical format: rtmp://ip/app/stream?vhost=VHOST This is used for some legacy devices, which does not support standard HTTP url query string. --------- Co-authored-by: chundonglinlin <chundonglinlin@163.com> Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
parent
99ca66ddc8
commit
b75668b509
6 changed files with 46 additions and 7 deletions
|
@ -3049,6 +3049,35 @@ VOID TEST(ProtocolRTMPTest, GenerateURL)
|
|||
}
|
||||
}
|
||||
|
||||
VOID TEST(ProtocolRTMPTest, DiscoveryTcUrlLegacy)
|
||||
{
|
||||
if (true) {
|
||||
int port; std::string tcUrl, schema, ip, vhost, app, stream, param;
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live...vhost...demo"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("demo", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
}
|
||||
|
||||
if (true) {
|
||||
int port; std::string tcUrl, schema, ip, vhost, app, stream, param;
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live...vhost...demo&token=abc"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("demo", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* discovery tcUrl to schema/vhost/host/port/app
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue