Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http/Https bug #101

Open
Loveday-Alfred opened this issue May 26, 2022 · 2 comments
Open

Http/Https bug #101

Loveday-Alfred opened this issue May 26, 2022 · 2 comments

Comments

@Loveday-Alfred
Copy link

am having this problem with the library...but it seems to work fine on localhost but not on the deployed version.
Mixed Content: The page at 'https://naija-radio-stream.netlify.app/' was loaded over HTTPS, but requested an insecure resource 'http://all.api.radio-browser.info/json/servers'. This request has been blocked; the content must be served over HTTPS.

@ivandotv
Copy link
Owner

That is an upstream issue.
API is not served over a secure connection.
segler-alex/radiobrowser-api-rust#122

In order to use the API, first, an API endpoint must be determined, that is just how the original creator has implemented the API.

const response = await fetch(
// this should be https when the above issue is resolved
'http://all.api.radio-browser.info/json/servers',
config

if (!this.baseUrl) {
const results = await this.resolveBaseUrl()
const random = Math.floor(Math.random() * results.length)
this.baseUrl = `https://${results[random].name}`
}

You can check out the setBaseUrl method and set the base URL manually or you can proxy the request thru a backend server.

@IhsenBen
Copy link

anyone up to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants