Skip to content

Commit 7b9a2d6

Browse files
RUST-1054 SOCKS5 Proxy Support (#1550)
1 parent 155def7 commit 7b9a2d6

File tree

17 files changed

+812
-273
lines changed

17 files changed

+812
-273
lines changed

.evergreen/config.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,35 @@ buildvariants:
399399
tasks:
400400
- happy-eyeballs-task-group
401401

402+
- name: socks5-proxy-no-tls
403+
display_name: "SOCKS5 Proxy (No TLS)"
404+
# patchable: false
405+
run_on:
406+
- rhel87-small
407+
tasks:
408+
- test-socks5-proxy
409+
410+
- name: socks5-proxy-tls
411+
display_name: "SOCKS5 Proxy (TLS)"
412+
# patchable: false
413+
run_on:
414+
- rhel87-small
415+
expansions:
416+
SSL: ssl
417+
tasks:
418+
- test-socks5-proxy
419+
420+
- name: socks5-proxy-openssl
421+
display_name: "SOCKS5 Proxy (OpenSSL)"
422+
# patchable: false
423+
run_on:
424+
- rhel87-small
425+
expansions:
426+
SSL: ssl
427+
OPENSSL: true
428+
tasks:
429+
- test-socks5-proxy
430+
402431
#- name: graviton-legacy
403432
# display_name: "Graviton (legacy versions)"
404433
# run_on:
@@ -1246,6 +1275,26 @@ tasks:
12461275
include_expansions_in_env:
12471276
- PROJECT_DIRECTORY
12481277

1278+
- name: test-socks5-proxy
1279+
commands:
1280+
- func: bootstrap mongo-orchestration
1281+
vars:
1282+
MONGODB_VERSION: rapid
1283+
TOPOLOGY: replica_set
1284+
- command: subprocess.exec
1285+
type: test
1286+
params:
1287+
working_dir: src
1288+
binary: bash
1289+
args:
1290+
- .evergreen/run-socks5-proxy-test.sh
1291+
include_expansions_in_env:
1292+
- PROJECT_DIRECTORY
1293+
- MONGODB_URI
1294+
- DRIVERS_TOOLS
1295+
- PYTHON3
1296+
- OPENSSL
1297+
12491298
#############
12501299
# Functions #
12511300
#############
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
source .evergreen/env.sh
6+
source .evergreen/cargo-test.sh
7+
8+
FEATURE_FLAGS+=("socks5-proxy")
9+
CARGO_OPTIONS+=("--ignore-default-filter")
10+
11+
if [ "$OPENSSL" = true ]; then
12+
FEATURE_FLAGS+=("openssl-tls")
13+
fi
14+
15+
# with auth
16+
$PYTHON3 $DRIVERS_TOOLS/.evergreen/socks5srv.py --port 1080 --auth "username:p4ssw0rd" --map "localhost:12345 to localhost:27017" &
17+
AUTH_PID=$!
18+
# without auth
19+
$PYTHON3 $DRIVERS_TOOLS/.evergreen/socks5srv.py --port 1081 --map "localhost:12345 to localhost:27017" &
20+
NOAUTH_PID=$!
21+
22+
set +o errexit
23+
24+
cargo_test socks5_proxy
25+
cargo_test run_uri_options_spec_tests
26+
27+
kill $AUTH_PID
28+
kill $NOAUTH_PID
29+
30+
exit ${CARGO_RESULT}

Cargo.lock

Lines changed: 51 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ features = ["sync"]
6060
| `text-indexes-unstable` | Enables support for text indexes in explicit encryption. This feature is in preview and should be used for experimental workloads only. This feature is unstable and its security is not guaranteed until released as Generally Available (GA). The GA version of this feature may not be backwards compatible with the preview version. |
6161
| `error-backtrace` | Capture backtraces in `Error` values. This can be slow, memory intensive, and very verbose. |
6262
| `bson-3` | Use version 3.x of the `bson` crate; for backwards compatibility, without this feature enabled `bson` 2.x is used. |
63+
| `socks5-proxy` | Enable SOCKS5 proxy support. |
6364

6465
## Web Framework Examples
6566

0 commit comments

Comments
 (0)