Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for addProxy (0.07 sec)

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

    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> {
        // Don't handle 'socket' schemes, which the RI's Socket class may request (for SOCKS).
    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/URLConnectionTest.kt

        // 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"),
            body = transferKind.newRequestBody("body"),
          )
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 133.2K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

        client =
          client
            .newBuilder()
            .proxySelector(
              FakeProxySelector()
                .addProxy(server2.proxyAddress)
                .addProxy(Proxy.NO_PROXY),
            ).build()
        server2.close()
        val request =
          Request(
            url = server.url("/"),
            body = "abc".toRequestBody("text/plain".toMediaType()),
    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