'How to set proxy authentication for source and target db of couchdb on replication

I am trying to acihive couchdb replication thruough proxy authentication. But I am getting error in source and Target db "unauthorized to acces db", since proxy auth is not setting for source and target db.

http://127.0.0.1:5984/_replicate
Content-Type:application/json
X-Auth-CouchDB-Roles:_admin
X-Auth-CouchDB-UserName:admin
X-Auth-CouchDB-Token:u9428u142u

body : {
    "source_proxy":"http://127.0.0.1:5984",
    "target_proxy":"http://127.0.0.1:5984",
    "source": "r2", 
    "target": "andrews", 
    "create_target": true, 
    "continuous": false
}

error:

    "error": "unauthorized",
    "reason": "unauthorized to access or create database http://127.0.0.1:5984/r2/"
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source