HLS edge server not playing

Why you do not know server IP where stream is published? Do you have autoscaling group of Origins behind a load balancer?
Yes Max.

You can use REST hook /publishStream, in this case you will always know Origin IP and stream published name on backend server.
You mean with custom backend server assigned to appKey.
If it is so, we need to have all API methods (like connect, publishStream, stopStream, StreamStatusEvent etc) allowed in the backend server.right?
 

Max

Administrator
Staff member
In case you have a couple of Origin servers behind load balancer the only correct way is to have a custom backend server to collect /publishStream REST hooks.
You mean with custom backend server assigned to appKey.
If it is so, we need to have all API methods (like connect, publishStream, stopStream, StreamStatusEvent etc) allowed in the backend server.right?
You can just mirror the content of REST methods with 200 OK header if you do not need to handle them. And you can replace defaultApp key with your custom backend. Please see the example replacing defaultApp and handling /connect method only.
The backend server instance should be in the same private network as Origin instances.
 
If nothing helps or reverse proxy solution looks too complex, we raised the ticket WCS-2807 to implement a setting that will enable to return HTTP origin request URL in ACAO header. We'll let you know in this topic about results.
Hi Max,
Is there any update on this ticket WCS-2807?
 

Max

Administrator
Staff member
Good day.
We added mask support in ACAO header in build 5.2.755. The feature is enabled by default
Code:
hls_acao_header_domain_mask=true
You can set * mask in ACAO header
Code:
hls_access_control_headers=Access-Control-Allow-Origin: *;...
and server will return origin request URL in ACAO header in response to GET
 

Max

Administrator
Staff member
Also is it possible to add wildcard domains like https://*.example.com?
This will violate ACAO header specification which officially supports no wildcard domains.
But with current implementation, server just returns origin request URL if * mask is given, for example
Code:
Access-Control-Allow-Origin: http://lb.example.com:8081
This should be enough for the case.
 
Top