0

通过 _changes 提要将沙发数据库从远程系统复制到本地系统时,出现此错误

`05-04 19:19:48.089: ERROR/CouchDB(984): [error] [<0.115.0>] Error in replication `a4b53e74a33b773bbca688073b6bbe0d+continuous` (triggered by document `cloud2airline`): {worker_died,<0.532.0>,
        {process_died,<0.547.0>,
        {function_clause,
        [{string,tokens1,[undefined,";",[]]},
        {mochiweb_util,parse_header,1},
        {couch_httpd,get_boundary,1},
        {couch_httpd,parse_multipart_request,3},
        {couch_api_wrap,'-open_doc_revs/6-fun-1-',4},
        {couch_api_wrap_httpc,process_stream_response,5},
        {couch_api_wrap,'-open_doc_revs/6-fun-2-',4}]}}}
        Restarting replication in 5 seconds.`

节点js代理代码

`'use strict';
/*!
 * Middleware for forwarding a request to CouchDB.
 */

/**
 * Module dependencies.
 */

var httpProxy = require('http-proxy'),
    util = require('./util');

module.exports = function(couch) {
    var proxy = new httpProxy.HttpProxy(couch),
        couchTarget = couch.target;
    httpProxy.setMaxSockets(200);

    return function(req, res, next) {
        req.headers['host'] = couchTarget.host + ':' + couchTarget.port;
        req.headers['authorization'] = couch.credentials;
        req.headers['x-forwarded-ssl'] = util.isSecureForwardedRequest(req);
        var forwardedFor = req.headers['x-forwarded-for'];
        req.headers['x-real-ip'] = forwardedFor
            ? forwardedFor.split(',',1)[0]
            : req.connection.remoteAddress;
        req.url = couch.path + req.url;
        console.log(req.headers['x-forwarded-for']);
        console.log(req.headers['x-real-ip']);
        console.log(req.headers['x-forwarded-ssl'] );
        console.log(couchTarget.host + ":" + couchTarget.port + req.url);
        return proxy.proxyRequest(req, res);
    }
}`
4

0 回答 0