CORS Support in Sync Gateway

2014-09-30 Thread Mike Kirkup
We are having trouble getting CORS set up to work properly within our 
environment and would love some help.

Here is out set up (on a single machine):
Ubuntu 14.04.1 (64 bit)
Couchbase Server Enterprise v2.5.1
Couchbase Sync Gateway Enterprise v1.0.0

We have set up the sync_gateway using a json file (pasted below) that 
includes the following elements to enable CORS support:
"CORS":{
   "Origin":["*"],
   
"Headers":["DNT","X-Mx-ReqToken","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type"],
   "MaxAge": 1728000
   },

All of the instructions that we have read and received on setting up CORS 
can be found in these two threads:
*https://github.com/couchbase/sync_gateway/issues/115*
*https://github.com/couchbase/sync_gateway/pull/265#comments*

However, after setting all of this up, we are still not seeing any changes 
to the headers upon requests to the sync gateway.  It isn’t clear from the 
issues list and pull page whether this has actually been integrated into 
the branch.  If not, is there a clean/easy way for us to build our own 
version of the sync gateway that would include this change?

Thanks!

{
"interface": ":4984",
"adminInterface": ":4985",
"CORS":{
   "Origin":["*"],
   
"Headers":["DNT","X-Mx-ReqToken","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type"],
   "MaxAge": 1728000
   },
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", 
"Shadow+", "Changes", "Changes+"],
"databases": {
"sync_gateway": {
"server": "*http://localhost:8091*";,
"bucket": "sync_gateway",
"sync": `function(doc) {channel(doc.channels);}`,
"users": {
"GUEST": {
"disabled": false,
"admin_channels": ["*"]
}
},
"shadow": {
 "server": "*http://localhost:8091*";,
 "bucket": "sync_gateway"
}
}
}
}
   

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to couchbase+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CORS Support in Sync Gateway

2014-10-01 Thread Mike Kirkup
We continued working through on this one and have effectively worked around 
sync gateway and its lack of support for CORS.  We have setup nginx as a 
proxy inbetween the sync gateway and our client application allowing us to 
handle the CORS requests at the proxy level and then pass the requests on 
the same domain to the sync gateway.  Someone should really, really, really 
look at integrating the changes that have already been put into the product.

Mike

On Tuesday, September 30, 2014 9:39:10 PM UTC-4, Mike Kirkup wrote:
>
> We are having trouble getting CORS set up to work properly within our 
> environment and would love some help.
>
> Here is out set up (on a single machine):
> Ubuntu 14.04.1 (64 bit)
> Couchbase Server Enterprise v2.5.1
> Couchbase Sync Gateway Enterprise v1.0.0
>
> We have set up the sync_gateway using a json file (pasted below) that 
> includes the following elements to enable CORS support:
> "CORS":{
>"Origin":["*"],
>
> "Headers":["DNT","X-Mx-ReqToken","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type"],
>"MaxAge": 1728000
>},
>
> All of the instructions that we have read and received on setting up CORS 
> can be found in these two threads:
> *https://github.com/couchbase/sync_gateway/issues/115 
> <https://github.com/couchbase/sync_gateway/issues/115>*
> *https://github.com/couchbase/sync_gateway/pull/265#comments 
> <https://github.com/couchbase/sync_gateway/pull/265#comments>*
>
> However, after setting all of this up, we are still not seeing any changes 
> to the headers upon requests to the sync gateway.  It isn’t clear from the 
> issues list and pull page whether this has actually been integrated into 
> the branch.  If not, is there a clean/easy way for us to build our own 
> version of the sync gateway that would include this change?
>
> Thanks!
>
> {
> "interface": ":4984",
> "adminInterface": ":4985",
> "CORS":{
>"Origin":["*"],
>
> "Headers":["DNT","X-Mx-ReqToken","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type"],
>"MaxAge": 1728000
>},
> "log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", 
> "Shadow+", "Changes", "Changes+"],
> "databases": {
> "sync_gateway": {
> "server": "*http://localhost:8091 <http://localhost:8091>*",
> "bucket": "sync_gateway",
> "sync": `function(doc) {channel(doc.channels);}`,
> "users": {
> "GUEST": {
> "disabled": false,
> "admin_channels": ["*"]
> }
> },
> "shadow": {
>  "server": "*http://localhost:8091 
> <http://localhost:8091>*",
>  "bucket": "sync_gateway"
> }
> }
> }
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to couchbase+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.