jstests/sharding/proxy_protocol_connect.js
// Test that you can connect to the load balancer port over a proxy.
Test that you can connect to the load balancer port over a proxy.
Test that you can connect to the load balancer port over a proxy .
function testProxyProtocolConnect(ingressPort, egressPort, version) {
    'use strict';
    let proxy_server = new ProxyProtocolServer(ingressPort, egressPort, version);
    proxy_server.start();
    let st = new ShardingTest(
        {shards: 1, mongos: 1, mongosOptions: {setParameter: {"loadBalancerPort": egressPort}}});
    const uri = `mongodb://127.0.0.1:${ingressPort}/?loadBalanced=true`;
    const conn = new Mongo(uri);
    assert.neq(null, conn, 'Client was unable to connect to the load balancer port');
    assert.commandWorked(conn.getDB('admin').runCommand({hello: 1}));
    proxy_server.stop();
    st.stop();
}
function testProxyProtocolConnect ( ingressPort , egressPort , version ) { 'use strict' ; let proxy_server = new ProxyProtocolServer ( ingressPort , egressPort , version ) ; proxy_server . start ( ) ; let st = new ShardingTest ( { shards : 1 , mongos : 1 , mongosOptions : { setParameter : { "loadBalancerPort" : egressPort } } } ) ; const uri = ` ${ ingressPort } ` ; const conn = new Mongo ( uri ) ; assert . neq ( null , conn , 'Client was unable to connect to the load balancer port' ) ; assert . commandWorked ( conn . getDB ( 'admin' ) . runCommand ( { hello : 1 } ) ) ; proxy_server . stop ( ) ; st . stop ( ) ; }
Test that you can connect to the load balancer port over a proxy.
Test that you can connect to the load balancer port over a proxy .