1
0
Fork 0
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:
chundonglinlin 2022-02-16 10:49:16 +08:00 committed by GitHub
parent 9379ebbc2c
commit 03cf93fc2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 335 additions and 33 deletions

View file

@ -10,6 +10,7 @@
#include <srs_core.hpp>
#include <string>
#include <vector>
class SrsHttpUri;
class SrsStSocket;
@ -79,6 +80,10 @@ public:
static srs_error_t on_hls_notify(SrsContextId cid, std::string url, SrsRequest* req, std::string ts_url, int nb_notify);
// Discover co-workers for origin cluster.
static srs_error_t discover_co_workers(std::string url, std::string& host, int& port);
// The on_forward_backend hook, when publish stream start to forward
// @param url the api server url, to valid the client.
// ignore if empty.
static srs_error_t on_forward_backend(std::string url, SrsRequest* req, std::vector<std::string>& rtmp_urls);
private:
static srs_error_t do_post(SrsHttpClient* hc, std::string url, std::string req, int& code, std::string& res);
};