Closed
Description
Run the following against a CouchDB 1.6 instance:
const { Client } = require('.')
const stream = require('stream')
const client = new Client('http://localhost:5984', {
socketTimeout: 10e3,
headersTimeout: 10e3
})
client.stream({
method: 'GET',
path: '/nxt/_changes?feed=continuous&heartbeat=5000'
}, ({ headers }) => {
console.log(headers)
return new stream.Writable({
write (chunk, encoding, callback) {
console.log(chunk.toString())
callback()
}
})
}, (err) => {
console.error(err)
})
Note that this is a long polling request.
It will log the headers and then after 10 seconds still fail with a headers timeout error.
Probably a problem in node_http_parser
in Node?