Page 1 of 1

Feature Request - CORS headers

Posted: Mon Mar 05, 2012 3:08 pm
by forkboy
Hi,

I am writing a completely custom UI for the BCS using javascript.

One of the problems with using javascript is the restrictions around Same Origin Policy which basically means you can't access the BCS directly from javascript, you need to run a server-side proxy. This limits where the device can be run (needs a web server, which then implies internet access).

Would it be possible to add CORS headers to BCS so that we can directly access the device without the need for a proxy? That would make it easier to use the device without internet access or on mobile devices on a local network. It would be a matter of adding a single response header to each of the APIs allowing all (or a configurable address) direct access like this:

Access-Control-Allow-Origin: http://api.bob.com

Details here: http://www.html5rocks.com/en/tutorials/cors/

Re: Feature Request - CORS headers

Posted: Wed Mar 07, 2012 6:55 am
by ECC
If you're using Javascript, you might be interested in MooCS, which does most of the BCS raw interface heavy lifting for you.
http://www.embeddedcc.com/wiki/index.php?title=Partners

I'll investigate the CORS headers, but I can't promise a release date.

Re: Feature Request - CORS headers

Posted: Thu Aug 23, 2012 11:21 pm
by bbrally
+1 to the Cors headers.

Unless I misunderstand how the MooCS works, it requires a server setup to run, making it impractical to write a website anyone can use with their BCS.

I'd love to hear from someone if I just don't understand enough yet.

Re: Feature Request - CORS headers

Posted: Tue Oct 09, 2012 2:34 pm
by ocluke
forkboy wrote: I am writing a completely custom UI for the BCS using javascript.
Is this with the focus of controlling a brewing system? Is this something you would be willing to share with others? It would be great to see more details on this, as a simple, easier to program on the fly UI would be wonderful to have for the BCS.

Re: Feature Request - CORS headers

Posted: Tue Sep 22, 2015 1:10 am
by forkboy
Hi just got the notification of release 4.0

I could not see anything from a quick look, but did an option for CORS requests make it into the new API?

Re: Feature Request - CORS headers

Posted: Tue Sep 22, 2015 1:24 am
by brahn
You bet! The utilities that do backup/restore, 3.x config migration, recipe values, PID tuning, etc all rely on using CORS.

Re: Feature Request - CORS headers

Posted: Tue Sep 22, 2015 2:43 am
by forkboy
that's awesome!... been waiting a long time for this.