mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #1031, Always use vhost in stream query, the unify uri. 3.0.35
This commit is contained in:
parent
8cf5df5afb
commit
68a1656e07
18 changed files with 102 additions and 159 deletions
|
@ -71,28 +71,16 @@ extern void srs_parse_query_string(std::string q, std::map<std::string, std::str
|
|||
extern void srs_random_generate(char* bytes, int size);
|
||||
|
||||
/**
|
||||
* generate the tcUrl.
|
||||
* @param param, the app parameters in tcUrl. for example, ?key=xxx,vhost=xxx
|
||||
* @return the tcUrl generated from ip/vhost/app/port.
|
||||
* @remark when vhost equals to __defaultVhost__, use ip as vhost.
|
||||
* @remark ignore port if port equals to default port 1935.
|
||||
* generate the tcUrl without param.
|
||||
* @remark Use host as tcUrl.vhost if vhost is default vhost.
|
||||
*/
|
||||
extern std::string srs_generate_tc_url(std::string ip, std::string vhost, std::string app, int port, std::string param);
|
||||
extern std::string srs_generate_tc_url(std::string host, std::string vhost, std::string app, int port);
|
||||
|
||||
/**
|
||||
* srs_detect_tools generate the normal tcUrl
|
||||
* Generate the stream with param.
|
||||
* @remark Append vhost in query string if not default vhost.
|
||||
*/
|
||||
extern std::string srs_generate_normal_tc_url(std::string ip, std::string vhost, std::string app, int port, std::string param);
|
||||
|
||||
/**
|
||||
* srs_detect_tools generate the normal tcUrl
|
||||
*/
|
||||
extern std::string srs_generate_via_tc_url(std::string ip, std::string vhost, std::string app, int port, std::string param);
|
||||
|
||||
/**
|
||||
* srs_detect_tools generate the vis/vis2 tcUrl
|
||||
*/
|
||||
extern std::string srs_generate_vis_tc_url(std::string ip, std::string vhost, std::string app, int port, std::string param);
|
||||
extern std::string srs_generate_stream_with_query(std::string host, std::string vhost, std::string stream, std::string param);
|
||||
|
||||
/**
|
||||
* create shared ptr message from bytes.
|
||||
|
@ -111,8 +99,9 @@ extern std::string srs_generate_stream_url(std::string vhost, std::string app, s
|
|||
// stream: livestream
|
||||
extern void srs_parse_rtmp_url(std::string url, std::string& tcUrl, std::string& stream);
|
||||
|
||||
// genereate the rtmp url, for instance, rtmp://server:port/app...vhost...vhost/stream
|
||||
extern std::string srs_generate_rtmp_url(std::string server, int port, std::string vhost, std::string app, std::string stream);
|
||||
// Genereate the rtmp url, for instance, rtmp://server:port/app/stream?param
|
||||
// @remark We always put vhost in param, in the query of url.
|
||||
extern std::string srs_generate_rtmp_url(std::string server, int port, std::string host, std::string vhost, std::string app, std::string stream, std::string param);
|
||||
|
||||
// write large numbers of iovs.
|
||||
extern srs_error_t srs_write_large_iovs(ISrsProtocolReaderWriter* skt, iovec* iovs, int size, ssize_t* pnwrite = NULL);
|
||||
|
@ -120,5 +109,8 @@ extern srs_error_t srs_write_large_iovs(ISrsProtocolReaderWriter* skt, iovec* io
|
|||
// join string in vector with indicated separator
|
||||
extern std::string srs_join_vector_string(std::vector<std::string>& vs, std::string separator);
|
||||
|
||||
// Whether domain is an IPv4 address.
|
||||
extern bool srs_is_ipv4(std::string domain);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue