Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Completed
Categories MongoDB Shell
Created by Guest
Created on Mar 16, 2022

Mongosh connection string thourgh proxy

Greetings, I need to create a proxy host in my environment so that ALL traffic between client <->Mongo Atlas goes through ONE single host. Problem is that if I use `mongodb+srv://server.example.com/` It returns me one of 50 endpoints to my Atlas cluster. I need something like: connect to this cluster, BUT use this proxy hop server.
  • Guest
    Apr 25, 2022
    This should work in mongosh 1.1.8+, which uses the Node.js driver 4.3.0 that includes support for connecting through SOCKS5 proxies (https://github.com/mongodb/node-mongodb-native/releases/tag/v4.3.0 ). The SOCKS5 options can be configured via the `proxyHost`, `proxyPort`, `proxyPassword` and `proxyUsername` options in the connection string.