Jamie C1648581710 Posted February 4, 2022 Share Posted February 4, 2022 Hey all, I am looking into trying AMS for a live DJ streaming platform. For this, I want the viewers to see the live viewers count. I was thinking of using the embedded web player. I can see from other posts here: https://github.com/ant-media/Ant-Media-Server/wiki/Embedded-Web-Player that an IFrame from the web player would be good <iframe width="560" height="315" src="https://your_domain_name:5443/LiveApp/play.html?name=125214322064017559554903" frameborder="0" allowfullscreen></iframe> I can see from the rest API that : /v2/broadcasts/active-live-stream-count is probably what I am looking for I know that the local IP 127.0.0.1 could call this but I want all my users from the iframe to be able to see this. So how can I go about getting this working? If I allow All IPs to do API calls they could just do something nasty to my server? Could I edit the player.html to display this out to all users from the server directly ? Can the active-live-stream-count just be added to the iframe and be displayed to all users without having to allow all IPs ? Not sure what is the best approach is Please help! J Link to comment Share on other sites More sharing options...
0 Connessione Posted February 4, 2022 Share Posted February 4, 2022 >From design standpoint it is better to wrap the actual api inside another outer api layer such as Amazon api gateway or your custom wrapper and expose only certain specific calls to public. The wrapper will use authentication to talk to actual API. This makes your system safe and secure. You can also use this wrapper system to create roles for finer access control to the actual API. Regards Link to comment Share on other sites More sharing options...
0 Jamie C1648581710 Posted February 7, 2022 Author Share Posted February 7, 2022 Hi, Thanks for replying. I have an account on Azure. Can I do this this on Azure API Management ? For either AWS or Azure, can you point me to a guide on how I can set this up / configure ? thanks Link to comment Share on other sites More sharing options...
0 Connessione Posted February 8, 2022 Share Posted February 8, 2022 I believe you should be able to implement the architecture on any platform. I am not very familiar with gcp api management though. I can explain the theory to you. Say I have 2 apis and both are accessible via authentication. I want to use just one for public website.. So what you do is create a public api endpoint for the one you want to expose. It is open and has no passwords. Now when you hit that api endpoint , it should use a function (server side / cloud function like lambda) to invoke the private api with authentication parameters as needed, the author details are provided in the function. The response is is fetched from the private api and returned to original caller of the public endpoint. (End to end fetch). So the user of the public api does not need to know auth details or where the data comes from. If your original api and public api service is on same server then it’s even better but otherwise your private api will need to be accessible to the public endpoint service through a public host or something. If they are on same server then it cans just access via localhost. Hope that gives some clarity on the subject. Regards Link to comment Share on other sites More sharing options...
Question
Jamie C1648581710
Hey all,
<iframe width="560" height="315" src="https://your_domain_name:5443/LiveApp/play.html?name=125214322064017559554903" frameborder="0" allowfullscreen></iframe>
Link to comment
Share on other sites
Top Posters For This Question
2
2
Popular Days
Feb 4
2
Feb 7
1
Feb 8
1
Top Posters For This Question
Connessione 2 posts
Jamie C1648581710 2 posts
Popular Days
Feb 4 2022
2 posts
Feb 7 2022
1 post
Feb 8 2022
1 post
3 answers to this question
Recommended Posts