Feature Request - CORS headers

Things to come.
Post Reply
forkboy
Posts: 8
Joined: Thu Feb 09, 2012 4:48 am
Bot?: No

Feature Request - CORS headers

Post 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/
User avatar
ECC
Posts: 676
Joined: Fri Sep 12, 2008 12:29 pm
Bot?: No
Contact:

Re: Feature Request - CORS headers

Post 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.
User avatar
bbrally
Posts: 210
Joined: Sat Mar 27, 2010 3:59 am
Bot?: No
Location: Vancouver, BC
Contact:

Re: Feature Request - CORS headers

Post 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.
ocluke
Posts: 10
Joined: Fri Mar 09, 2012 12:21 pm
Bot?: No

Re: Feature Request - CORS headers

Post 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.
forkboy
Posts: 8
Joined: Thu Feb 09, 2012 4:48 am
Bot?: No

Re: Feature Request - CORS headers

Post 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?
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Feature Request - CORS headers

Post by brahn »

You bet! The utilities that do backup/restore, 3.x config migration, recipe values, PID tuning, etc all rely on using CORS.
forkboy
Posts: 8
Joined: Thu Feb 09, 2012 4:48 am
Bot?: No

Re: Feature Request - CORS headers

Post by forkboy »

that's awesome!... been waiting a long time for this.
Post Reply