Skip to content

Commit ec10274

Browse files
authored
DOCSP-42523 Proxy Configuration Support (#350)
* DOCSP-42523 Proxy Configuration Support * table widths * * * JD feedback * nit
1 parent 0c9a828 commit ec10274

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

source/connect.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,24 @@ following command:
357357

358358
mongosh "mongodb://localhost:27017/qa"
359359

360+
Proxy Settings
361+
~~~~~~~~~~~~~~
362+
363+
To establish a connection with proxy configurations, you can use the
364+
following environment variables:
365+
366+
.. include:: /includes/table-proxy-env-variables.rst
367+
368+
.. note::
369+
370+
``mongosh`` supports the following proxy types:
371+
372+
- Socks5 proxies
373+
- HTTP proxies
374+
- CONNECT proxies
375+
- :abbr:`PAC (proxy auto-config)` URLs that resolve to one of the previously
376+
listed proxies
377+
360378
Connect to a Different Deployment
361379
---------------------------------
362380

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:widths: 20 35 45
4+
5+
* - Variable
6+
- Description
7+
- Example
8+
9+
* - ``MONGODB_PROXY``
10+
11+
- Proxy connections to ``mongodb://`` and ``mongodb+srv://`` URLs, such
12+
as database clusters.
13+
14+
- The following example sets the ``MONGODB_PROXY`` environment variable to
15+
proxy all MongoDB connections through a CONNECT proxy located at
16+
``example.com:8080`` with TLS enabled.
17+
18+
.. code-block:: sh
19+
:copyable: false
20+
21+
export MONGODB_PROXY=https://example.com:8080
22+
23+
* - ``HTTP_PROXY``
24+
25+
- Proxy connections to ``http://`` URLs. HTTP connections are mostly
26+
used for OIDC authentication.
27+
28+
If you also set ``HTTPS_PROXY``, the value of ``HTTPS_PROXY`` takes
29+
precedence for all requests.
30+
31+
- The following example sets the ``HTTP_PROXY`` environment variable to
32+
proxy HTTP connections through a CONNECT proxy located at
33+
``example.com:8080``:
34+
35+
.. code-block:: sh
36+
:copyable: false
37+
38+
export HTTP_PROXY=http://example.com:8080
39+
40+
* - ``HTTPS_PROXY``
41+
42+
- Proxy connections to ``https://`` URLs. HTTPS connections are mostly
43+
used for OIDC authentication.
44+
45+
If you also set ``HTTP_PROXY``, the value of ``HTTPS_PROXY`` takes
46+
precedence for all requests.
47+
48+
- The following example sets the ``HTTPS_PROXY`` environment variable to
49+
proxy all HTTPS connections through a CONNECT proxy located at
50+
``localhost:8080`` without TLS:
51+
52+
.. code-block:: sh
53+
:copyable: false
54+
55+
export HTTPS_PROXY=http://localhost:8080
56+
57+
* - ``ALL_PROXY``
58+
59+
- Proxy all connections to the specified URL.
60+
61+
- The following example sets the ``ALL_PROXY`` environment variable to
62+
proxy all outbound network connections through a Socks5 proxy located at
63+
``example.com:1234`` with credentials included in the URL:
64+
65+
.. code-block:: sh
66+
:copyable: false
67+
68+
export ALL_PROXY=socks5://username:[email protected]:1234
69+
70+
* - ``NO_PROXY``
71+
72+
- Comma-separated list of hostnames that should be excluded from
73+
proxying.
74+
75+
- The following example sets the ``NO_PROXY`` environment variable to
76+
bypass the proxy for connections to ``localhost`` and
77+
``internal-db.example.com``.
78+
79+
.. code-block:: sh
80+
:copyable: false
81+
82+
export NO_PROXY=localhost,internal-db.example.com

0 commit comments

Comments
 (0)