4

I'm running a simple app on React to display audio tracks from files I have uploaded on https://my.pcloud.com/ using the React-Player component.

However, the track doesn't display and I receive the following error on my console:

"Cross-Origin Read Blocking (CORB) blocked cross-origin response https://my.pcloud.com/publink/show?code=XZlsqq7ZK4mnFfNp1rJq8neYkc77Gp0yCd17 with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details."

I've done some searches and I realized I need to do some server side things to get around this. Any way I could do something on the client side to work around this? If not, any good tutorials/guides on how to set up a server and get the content I need for my audio player? Thanks!

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
user11186642
  • 41
  • 2
  • 3
  • CORS/CORB issues boil down to your browser not accepting certain endpoints because certain CORS headers are not present in the response. There are browser plugins for adding these headers for your own browser for testing, but for production you have to fix this in the backend – Tholle Mar 11 '19 at 17:53
  • The error message cited in the question indicates your code is trying to use a text/html response in some context where the browser doesn’t expect text/html. `https://my.pcloud.com/publink/show?code=XZlsqq7ZK4mnFfNp1rJq8neYkc77Gp0yCd17` is an HTML page that shows an embedded player for playing a rainbow.mp3 file. Based on the description in the question, it seems maybe your code is trying to load take that `https://my.pcloud.com/publink/show?code=XZlsqq7ZK4mnFfNp1rJq8neYkc77Gp0yCd17` HTML page and use it somewhere you should instead be using the rainbow.mp3 file. – sideshowbarker Mar 12 '19 at 07:53
  • If you actually just want the rainbow.mp3 file, then it looks you can get that from the URL `https://p-def7.pcloud.com/cBZDcSShLZuYtsxLZZZBhhJA7Z2ZZufXZkZE77RZV5Z77ZNVZl7Zf7ZK5ZDXZv0ZiXZS0ZVkZe0ZO5ZlkZlsqq7Z3fHmYtB5FLbucQWM4cXnUBbXqzny/rainbow.mp3` – sideshowbarker Mar 12 '19 at 07:54
  • hey @sideshowbarker i think you're right. i was trying to just get the mp3 file instead of the whole html page. basically, i'm just trying to play an mp3 file uploaded online. any tips on how to do this? – user11186642 Mar 15 '19 at 21:10

1 Answers1

0

I had the same problem and I could solve it by using a proxy like this. There is a "How to use" part in description that can help you to setup. Happy coding :-)

** EDIT **

I (the editor) copied and pasted the url's content to this answer for seo purposes

A super mini php proxy made within 5 minutes for multiple uses.

I've made this just becouse i work with a vm machine in my pc as testing area but i got an ip like 192.168.231.128 that will be not visible from outside my pc. For test a web site in my smartphone I have used this for bypass this restriction problem calling an url as http://192.168.1.4/proxy/192.168.231.128/.

How to use:

Just call the address you want to visit after your superminiphpproxy path.

Eg. http://127.0.0.1/proxy/www.google.com http://www.yourwebsite.com/proxy/www.google.com

Enjoy it!

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
Ali Bakhtiar
  • 178
  • 11