Comments (4)
i have to add one or more things:
- only construct the list of servers on program start, and than randomize it and then start by using the first server
- on error, continue by using the second in the already in the first step randomized list.
- please do not call /json/stats at all just for checking if it works. the best way to do it is just using the server. and if it does not work fall back to the next in the list
at the moment traffic is no problem, but i want to optimize this early on, traffic will grow to the servers.
from tuner.
Hi @segler-alex
Thank you very much for creating this issue and keeping an eye on this little project!
You may have seen some code that is commented out. In the commit I do loop over the list of servers and check for a HTTP 200 on /json/stats until the first sucessfull response. So most likely it will always choose the first server, which is a static list of the three currently available servers. I've also reviewed the Grafana traffic stats and noticed that de1
has a lot of traffic compared to nl1
and fr1
, so I will randomize the list π.
Having said that, I ran into an issue using the proposed strategy as described on https://api.radio-browser.info/. While doing a DNS resolution on all.api.radio-browser.info
is fast and straightforward, reverse-resolving the hostnames (3 x IPv4 and 3 x IPv6) takes too much time. I've tried to use the API server with IPs only but then the API didn't respond properly so I assume there is a virtual host config in place.
This is why for now I have hard-coded the list of the three servers just to speed up this process, which is done before the App window appears on the screen.
Maybe you want to implement a strategy using DNS SRV records: https://en.wikipedia.org/wiki/SRV_record
or just put CNAME records on the DNS zone so reverse-resolving the IP addresses will not be required any more?
So this is what I'll do for now:
- Step1: Randomize the list of servers on startup
- Step2: Remove the need to check on /json/stats by implementing a retry strategy based on the randomized list of servers from Step1
- Step3: Dynamically fetch the list of servers using DNS requests in the background and store that list in the app settings so it will have to be done on every app start
from tuner.
hi, thank you for the tip with SRV records, i did now create them. you can check with (on linux shell):
$ dig _api._tcp.radio-browser.info SRV
or on the web with
https://mxtoolbox.com/SuperTool.aspx?action=srv%3a_api._tcp.radio-browser.info&run=toolpage
this is really helpfull because as you said, it does not need a reverse lookup but gives you directly a list of server names.
could you try it and use it?
i do not understand what you meant with CNAME. could you explain further what to do there?
CNAMEs are just links to other DNS names, but they get translated to IPs and that is not what a client would need. you need the real name because of the SSL certificate. the certificate references the name and is only legal if you use the real name (de1.api.radio-browser.info for example)
from tuner.
i added the DNS SRV records as alternative to the documentation at https://api.radio-browser.info/
from tuner.
Related Issues (20)
- Feature request: History feature
- Feature request: Display of stream url HOT 3
- Tuner makes no sound - Arch Linux HOT 4
- Any plans to switch to libsoup3? HOT 2
- Add filters HOT 1
- How to disable tracking by default?
- Remove usage of Gnome Location Services
- Feature request: Add the possibility to copy the music title HOT 1
- Station(s) radio with AAC+ 32kb don't sounds
- Feature request: Sorting of starred stations by drag and drop
- Radio stations stop playing after 5 minutes
- Syntax Error from Merge Translations
- Tuner playback do not stop when I have logged out from mate-session on Termux Android and Ubuntu 22.04 LTS (Jammy Jellyfish)Β AArch 64
- wwwaaaaaatttt??? (problem whith flathub.org ?) HOT 1
- How can I add new language to weblate?
- Tuner Won't Browse Radio Station
- wishful thinking...
- DBUS: MPRIS: Metadata `xesam:title` hardcoded to `Tuner` instead of showing title from radio station HOT 2
- Feature request: DBUS: MPRIS: `Next`/`Previous` commands go to next/previous radio station
- I can not build on Debian Buster AArch 64 architecture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuner.