File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1119,4 +1119,21 @@ async fn socks5_proxy() {
11191119 ) )
11201120 . await
11211121 . unwrap ( ) ;
1122+
1123+ // From the spec: Drivers MUST verify for at least one of the connection strings marked
1124+ // (succeeds) that command monitoring events do not reference the SOCKS5 proxy host where the
1125+ // MongoDB service server/port are referenced.
1126+ let uri = format ! (
1127+ "mongodb://{mapped_host}/?proxyHost={ipv4_localhost}&proxyPort=1081&\
1128+ directConnection=true{tls}"
1129+ ) ;
1130+ let options = ClientOptions :: parse ( uri) . await . unwrap ( ) ;
1131+ let client = Client :: for_test ( ) . options ( options) . monitor_events ( ) . await ;
1132+ client
1133+ . database ( "db" )
1134+ . run_command ( doc ! { "ping" : 1 } )
1135+ . await
1136+ . unwrap ( ) ;
1137+ let ( started, _) = client. events . get_successful_command_execution ( "ping" ) ;
1138+ assert_eq ! ( & started. connection. address. to_string( ) , mapped_host) ;
11221139}
You can’t perform that action at this time.
0 commit comments