mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Forward: support config full rtmp url forward to other server (#2799)
* Forward: add backend config and demo server for dynamic create forwarder to other server.(#1342) * Forward: if call forward backend failed, then return directly. * Forward: add API description and change return value format. * Forward: add backend conf file and wrapper function for backend service. * Forward: add backend comment in full.conf and update forward.backend.conf. * Forward: rename backend param and add comment tips.
This commit is contained in:
parent
9379ebbc2c
commit
03cf93fc2b
11 changed files with 335 additions and 33 deletions
|
@ -2825,7 +2825,7 @@ srs_error_t SrsConfig::check_normal_config()
|
|||
} else if (n == "forward") {
|
||||
for (int j = 0; j < (int)conf->directives.size(); j++) {
|
||||
string m = conf->at(j)->name;
|
||||
if (m != "enabled" && m != "destination") {
|
||||
if (m != "enabled" && m != "destination" && m != "backend") {
|
||||
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.forward.%s of %s", m.c_str(), vhost->arg0().c_str());
|
||||
}
|
||||
}
|
||||
|
@ -4635,6 +4635,21 @@ SrsConfDirective* SrsConfig::get_forwards(string vhost)
|
|||
return conf->get("destination");
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_forward_backend(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
if (!conf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
conf = conf->get("forward");
|
||||
if (!conf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conf->get("backend");
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_vhost_http_hooks(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue