CORS?

Started by dolst
2e8162aead7a85513d4e4c1e3a7bc06f?s=128&d=mm

dolst

Greetings, everyone. I'm trying to build a web app with HTML5 and jQuery components to make API calls to the device. (I have my reasons for this.)
The problem I am running into is that CORS (Cross-Origin Resource Sharing) is blocking my AJAX requests, since my local HTML file is obviously not the same "domain" as my Aurora.
I have not been able to find anything in the API docs about Access-Control-Allow-Origin settings for the Aurora, so I am assuming this is not something that is part of it. Is there a way to edit/alter this setting, assuming it exists in the Aurora? If not, is there any chance a firmware revision might allow this setting to be added, managed, changed, etc.?
And I'm sure there will be some who are curious as to why I'm even going down this road, so if you really want to know, I can elaborate.
Thanks!

0cf42d02f6a7d36f678efd111193855e?s=128&d=mm

peternewman

Not an answer, but a possible workaround; when I wanted to do something similar, I just proxied the device I was trying to control with Apache (other webservers are available), so my calls were then going to an address on the same server, and the problem goes away. I realise it's not perfect, but it may help you in the short term.

2e8162aead7a85513d4e4c1e3a7bc06f?s=128&d=mm

dolst

Hey there,

Yeah, that's the route I have ended up going. Ideally, I was going to make an HTML5 webapp using web storage that I could just drop onto any of our devices. Ordinarily, I'd use the official app but it requires an internet connection, which I can't guarantee I'll have wherever I take this thing. (Using it for lighting effects onstage.)
So I dug up my ten year-old HP/Compaq laptop, did a thumb drive install of CentOS 7 on it, and put the whole works on its own little network. (Reusing old gear ftw!)
The final rig will be the Aurora stuck/bolted to a piece of plywood on the front (already done and working), with a power strip, laptop, and wireless router all bolted to the back.
A PHP-based web interface available through a hidden wifi connection independent of any available internet connection (or lack thereof) will allow pretty much any wifi-enabled device to be a control for it. Now I just have to dust off my old PHP dev hat and jam it back on my head. The sky's the limit!
Still, just doing it all with jQuery could have eliminated one (rather significant) piece of hardware from the equation. Oh well. Back to the coding!
Surf Wisely.