Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for FakeProxySelector (0.18 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/FakeProxySelector.kt

    import java.io.IOException
    import java.net.Proxy
    import java.net.ProxySelector
    import java.net.SocketAddress
    import java.net.URI
    
    class FakeProxySelector : ProxySelector() {
      val proxies: MutableList<Proxy> = mutableListOf()
    
      fun addProxy(proxy: Proxy): FakeProxySelector {
        proxies.add(proxy)
        return this
      }
    
      override fun select(uri: URI): List<Proxy> {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/OkHttpClientTest.kt

          .isInstanceOf(NullProxySelector::class.java)
        client =
          OkHttpClient
            .Builder()
            .proxySelector(FakeProxySelector())
            .build()
        assertThat(client.proxy).isNull()
        assertThat(client.proxySelector)
          .isInstanceOf(FakeProxySelector::class.java)
      }
    
      @Test fun sharesRouteDatabase() {
        val client =
          OkHttpClient
            .Builder()
            .build()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 13.4K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        server.enqueue(MockResponse(body = "abc"))
    
        // Use a misconfigured proxy to guarantee that the request is retried.
        client =
          client
            .newBuilder()
            .proxySelector(
              FakeProxySelector()
                .addProxy(server2.proxyAddress)
                .addProxy(Proxy.NO_PROXY),
            ).build()
        server2.close()
        val request =
          Request(
            url = server.url("/def"),
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

        // Enable a misconfigured proxy selector to guarantee that the request is retried.
        client =
          client
            .newBuilder()
            .proxySelector(
              FakeProxySelector()
                .addProxy(server2.proxyAddress)
                .addProxy(Proxy.NO_PROXY),
            ).build()
        server2.close()
        val request =
          Request(
            url = server.url("/"),
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 146.6K bytes
    - Viewed (0)
Back to top