uclaradio.com
uclaradio.com copied to clipboard
Add detector/alert user when they are on a port-blocking network
Context
The UCLA radio stream does not work on networks like UCLA_WEB/UCLA_WEB_RES because those networks block all ports except for HTTP/HTTPS. Since the stream runs on a different port, it is blocked by this filter.
There is already a warning on uclaradio.com telling users to switch networks to make the stream work, but it would be better to proactively check if those ports are closed (maybe by starting a new webserver on port 8081 and pinging that server) and display a warning alert to the user if the port connection was not successful.
This is a great idea 👍🏼
I've written some code for this, but I can't go any further with making this possible unless I can get confirmation that we can change HTTP headers on whatever server is running the production site.
We need to add something like this to the http header list: Access-Control-Allow-Origin: * (except we should probably not use * and use something like uclaradio.com:8080 or whatever test port we can ping that is not http or https)
With this added, a request can be made from the client to that port, and if that port cannot be reached then most likely the stream also cannot be reached (since WEB and WEB_RES block everything but 80 and 443)
Reference: https://stackoverflow.com/questions/19966707/cors-error-on-same-domain https://enable-cors.org/