@Test public void meshProxyClientChangesTargetAndInjectHostHeader() throws Exception { server.enqueue(new MockResponse().setBody("foo")); String serviceUrl = "http: ClientConfiguration proxiedConfig = ClientConfiguration.builder() .from(createTestConfig(serviceUrl)) .meshProxy(HostAndPort.fromParts("localhost", server.getPort())) .maxNumRetries(0) .build(); OkHttpClient client = OkHttpClients.create(proxiedConfig, AGENT, hostEventsSink, OkHttpClientsTest.class); assertThat(client.newCall(new Request.Builder().url(serviceUrl).build()) .execute() .body() .string()) .isEqualTo("foo"); assertThat(server.takeRequest().getHeader(HttpHeaders.HOST)).isEqualTo("foo.com"); }
public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); static OkHttpClient create(
            ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass); static OkHttpClient create(
            OkHttpClient.Builder client,
            ClientConfiguration config,
            UserAgent userAgent,
            HostEventsSink hostEventsSink,
            Class<?> serviceClass); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); static OkHttpClient create(
            ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass); static OkHttpClient create(
            OkHttpClient.Builder client,
            ClientConfiguration config,
            UserAgent userAgent,
            HostEventsSink hostEventsSink,
            Class<?> serviceClass);  }