Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

ACCESS-CONTROL-ALLOW-ORIGN problem would seem to be something that should be mentioned

1 reply [Last post]
  • Login or register to post comments
Sat, 05/14/2011 - 12:53
daden
Offline
Joined: 05/14/2011
Groups: None

Having spent the better part of a day that I didn't have to waste trying to get couchdb to work with jQuery, this post may be a bit distempered. (If I'm wrong, I'll be more than happy to admit it.)

See my previous post about jquery.couch.js not working with current versions of jQuery.

Now, I find out that -- thanks to Chrome's detailed messages -- that I can't access couchdb from a different domain and that seems to include a different port on the same domain.

I have couchdb installed and apparently working on my laptop on port 5984, the default. I access it with http://localhost:5984/_utils.

My application is running on IIS from http://localhost/

Trying to do $.ajax() requests from my app consistently fails due to the access control issue (which doesn't show up in Firebug, btw, but does show up in Chrome's developer tools).

According to what I googled, there is no way to configure couchdb to serve up to other addresses.

My first decision was that couchdb was pretty much useless if not available from other addresses though that was a bit unfair because the problem relates to something intrinsic to web browsers and making http requests from them -- the need to be secure against cross-domain scripts.

But, having said that, it seems to me that this issue should be prominently highlighted in the documentation. I suppose many people familiar with Ajax driven apps will be familiar with it, but those of us who are somewhat new to the party would be helped by pointing out that in order to use couchdb across domains you'll likely need some kind of server-side code to make it work.

Not knowing that one quirk can, I can attest, waste a tremendous amount of time.

Top
  • Login or register to post comments
Tue, 05/17/2011 - 10:25
TimSmith
Offline
Joined: 02/09/2011
Groups:

Hi, daden,

CouchDB binds by default only to localhost, but you can change that by setting this in the local.ini file:

[httpd]
bind_address = 0.0.0.0

Ensure that the line is not commented out (it should not start with ';'). Restart the server, and it will be listening on all interfaces. Typically this is done when the server is behind a firewall or otherwise limiting access from the outside world.

If this doesn't answer your question, please post some detailed error messages so we can understand what's happening better. Also, let us know what language your application is in, and what REST or CouchDB client interface you're using to connect to the Couch server.

Thanks,

Tim

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker