creationix / couch-client

A minimal CouchDB client that easy and powerful
MIT License
101 stars 9 forks source link

Default Port of 5984 Breaking Connections to Cloudant over HTTPS #29

Open mhemesath opened 13 years ago

mhemesath commented 13 years ago

I'm trying to setup an app on Heroku. Heroku provides the URL to the your couch instance through an environment variable. So connecting to the database would be achieved like this:

var CouchClient = require('couch-client');
var client = new CouchClient(process.env.CLOUDANT_URL + "/myDocument")

The resulting URL is over HTTPs, however, because the port 5984 is defaulted, the connection never works.

See: http://support.cloudant.com/kb/faqs/does-cloudant-support-ssl And: http://devcenter.heroku.com/articles/cloudant

hdachev commented 13 years ago

Try setting CLOUDANT_URL to "https://username:password@host:443"

mhemesath commented 13 years ago

Yeah, I have that coded in for now and it seems to work. It's a bit weird though, as a working URL is supplied by Heroku on

process.env.CLOUDANT_URL

and I have to end up doing

 process.env.CLOUDANT_URL + ":443/myDocument"