Thanks Adam, that makes sense. (Except that one doesn't have this issue with other APIs...)
Do you know if there is a way to create a SSH tunnel using JavaScript but without using Node.js? I've searched for one but it doesn't look as if there is. Regards, *Yvonne Aburrow* Applications Developer Information Systems Team *IT Services <http://www.brookes.ac.uk/obis/>* Oxford Brookes University <http://www.brookes.ac.uk/> extn 2706 For enquiries and issues with live systems, please email [email protected] On 29 November 2017 at 14:48, Adam Kocoloski <[email protected]> wrote: > Hi Yvonne, yes, either the remote CouchDB instance needs to be directly > accessible from the internet, or you need some kind of tunnel or proxy that > will provide access to it. PouchDB is not special in this respect; it’s > using the same API as everyone else. Cheers, > > Adam > > > On Nov 29, 2017, at 5:15 AM, Yvonne Aburrow <[email protected]> > wrote: > > > > oops I mean SSH tunnel > > > > Regards, > > > > *Yvonne Aburrow* > > Applications Developer > > Information Systems Team > > *IT Services <http://www.brookes.ac.uk/obis/>* > > Oxford Brookes University <http://www.brookes.ac.uk/> > > > > extn 2706 > > > > For enquiries and issues with live systems, please email > > [email protected] > > > > > > > > On 29 November 2017 at 09:48, Yvonne Aburrow <[email protected]> > wrote: > > > >> Thanks Adam > >> > >> Unfortunately that still didn't work - I got ERR_CONNECTION_RESET again. > >> > >> I am wondering if I need to use a SSL tunnel to create a local instance > (I > >> had to do that to access Fauxton). > >> > >> There doesn't seem to be a script for SSL tunnelling that doesn't > involve > >> using Node.js > >> > >> Regards, > >> > >> *Yvonne Aburrow* > >> Applications Developer > >> Information Systems Team > >> *IT Services <http://www.brookes.ac.uk/obis/>* > >> Oxford Brookes University <http://www.brookes.ac.uk/> > >> > >> extn 2706 > >> > >> For enquiries and issues with live systems, please email > >> [email protected] > >> > >> > >> > >> On 28 November 2017 at 20:40, Adam Kocoloski <[email protected]> > wrote: > >> > >>> Hi Yvonne, > >>> > >>> It looks like you’re trying to make an HTTPS connection to port 5984. > Did > >>> you customize the server config? The default CouchDB configuration us > port > >>> *6984* for HTTPS. Cheers, > >>> > >>> Adam > >>> > >>>> On Nov 28, 2017, at 9:37 AM, Yvonne Aburrow <[email protected]> > >>> wrote: > >>>> > >>>> I am trying to sync a local PouchDB instance with a remote CouchDB > >>> instance > >>>> on Google App Engine. I am not using Node.js > >>>> > >>>> I have successfully logged in to the remote instance > >>>> <https://stackoverflow.com/questions/47474384/couchdb-login- > >>> access-on-google-app-engine>, > >>>> but I am getting the following error when I try to sync: > >>>> > >>>> replication paused (e.g. user went offline) > >>>> pouchdb-6.3.4.min.js:9 GET > >>>> https://<ipaddress>:5984/pouchnotes/?_nonce=1511870134012 > >>>> net::ERR_CONNECTION_RESET > >>>> > >>>> *This is my sync function:* > >>>> > >>>> PouchNotesObj.prototype.syncnoteset = function (start, end) { > >>>> var start = new Date().getTime(); > >>>> document.getElementById("syncbutton").innerHTML = "Syncing..."; > >>>> > >>>> var i, > >>>> that = this, > >>>> > >>>> options = { > >>>> doc_ids:['1450853987668'] > >>>> }; > >>>> > >>>> > >>>> //options.include_docs = true; > >>>> > >>>> if(start){ options.startkey = start; } > >>>> if(end){ options.endkey = end; } > >>>> > >>>> PouchDB.sync(this.dbname, this.remote, { retry: true }) > >>>> //this.pdb.sync(this.remote, { doc_id:['1450853987668'] }) > >>>> .on('change', function (info) { > >>>> console.log('change'); > >>>> document.getElementById("syncbutton").innerHTML = "Sync Notes"; > >>>> }).on('paused', function () { > >>>> console.log('replication paused (e.g. user went offline)'); > >>>> document.getElementById("syncbutton").innerHTML = "Sync Notes"; > >>>> }).on('active', function () { > >>>> console.log('replicate resumed (e.g. user went back > online)'); > >>>> document.getElementById("syncbutton").innerHTML = "Sync Notes"; > >>>> }).on('denied', function (info) { > >>>> console.log('a document failed to replicate, e.g. due to > >>>> permissions'); > >>>> document.getElementById("syncbutton").innerHTML = "Sync Notes"; > >>>> }).on('complete', function (info) { > >>>> console.log("Sync Complete"); > >>>> document.getElementById("syncbutton").innerHTML = "Sync > >>> Notes"; > >>>> that.viewnoteset(); > >>>> that.formobject.reset(); > >>>> that.show(that.formobject.dataset.show); > >>>> that.hide(that.formobject.dataset.hide); > >>>> var end = new Date().getTime(); > >>>> console.log("Time Taken - " + (end - start) + " ms"); > >>>> }).on('error', function (error) { > >>>> console.log("Sync Error:" + JSON.stringify(error)); > >>>> alert("Sync Error:" + error); > >>>> that.showerror(error); > >>>> }); > >>>> > >>>> } > >>>> > >>>> Any idea what is causing the connection to reset? > >>>> > >>>> > >>>> Regards, > >>>> > >>>> *Yvonne Aburrow* > >>>> Applications Developer > >>>> Information Systems Team > >>>> *IT Services <http://www.brookes.ac.uk/obis/>* > >>>> Oxford Brookes University <http://www.brookes.ac.uk/> > >>>> > >>>> extn 2706 > >>> > >>> > >> > >
