I have created my own CORS Proxy installation on Heroku. I downloaded heroku files, extracted to my D disk. I created new app and used cmd:
git init
heroku git:remote -a MY-APP-NAME
git add .
git config --global user.email "MY MAIL"
git config --global user.name "MY NAME"
git commit -am "CORS PROXY"
git push heroku master
Now my cors url is like this:
https://MY-APP-NAME.herokuapp.com/
But when I try to use this for example:
var url = cors_url + "https://itunes.apple.com/search?term==" + encodeURI(artist) + "-" + encodeURI(title) + "&media=music&limit=1";
$.ajax ({
dataType: 'text',
url: url,
crossDomain:true,
success:
function(result) {
},
error:
function(er) {
console.log(er)
}
});
I still get cors error:
Access to XMLHttpRequest at 'https://MY-APP-NAME.herokuapp.com/http://stream.rockradio.si:9034/stats?sid=1&json=1' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.