Using mongoose and mlab behind a proxy

2019-06-17 09:08发布

问题:

Can't connect to my mlab database if I'm behind a proxy.

Any idea how to achieve this? I've already googled and found no answer...

Here is my connection:

mongoose.connect(config.db.URI);
var db = mongoose.connection;
db.on('error', function(){
    throw new Error('unable to connect to database at ' + config.db.URI);
});