mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #277, support http vhost mount.
This commit is contained in:
parent
4513486266
commit
2742c0d3c2
5 changed files with 32 additions and 11 deletions
|
@ -165,12 +165,16 @@ int SrsHttpServer::initialize()
|
|||
|
||||
std::string mount = _srs_config->get_vhost_http_mount(vhost);
|
||||
std::string dir = _srs_config->get_vhost_http_dir(vhost);
|
||||
|
||||
// replace the vhost variable
|
||||
mount = srs_string_replace(mount, "[vhost]", vhost);
|
||||
|
||||
// the dir mount must always ends with "/"
|
||||
if (mount != "/" && mount.rfind("/") != mount.length() - 1) {
|
||||
mount += "/";
|
||||
}
|
||||
|
||||
// mount the http of vhost.
|
||||
if ((ret = mux.handle(mount, new SrsVodStream(dir))) != ERROR_SUCCESS) {
|
||||
srs_error("http: mount dir=%s for vhost=%s failed. ret=%d", dir.c_str(), vhost.c_str(), ret);
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue