larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/internal/connection/RealConnection.java
private void connectTunnel(int connectTimeout, int readTimeout, int writeTimeout, Call call,
      EventListener eventListener) throws IOException {
    Request tunnelRequest = createTunnelRequest();
    HttpUrl url = tunnelRequest.url();
    for (int i = 0; i < MAX_TUNNEL_ATTEMPTS; i++) {
      connectSocket(connectTimeout, readTimeout, call, eventListener);
      tunnelRequest = createTunnel(readTimeout, writeTimeout, tunnelRequest, url);

      if (tunnelRequest == null) break; // Tunnel successfully created.

      // The proxy decided to close the connection after an auth challenge. We need to create a new
      // connection, but this time with the auth credentials.
      closeQuietly(rawSocket);
      rawSocket = null;
      sink = null;
      source = null;
      eventListener.connectEnd(call, route.socketAddress(), route.proxy(), null);
    }
  }
/**
   * Does all the work to build an HTTPS connection over a proxy tunnel. The catch here is that a
   * proxy server can issue an auth challenge and then close the connection.
   */
Does all the work to build an HTTPS connection over a proxy tunnel. The catch here is that a
proxy server can issue an auth challenge and then close the connection.
Does all the work to build an HTTPS connection over a proxy tunnel . The catch here is that a proxy server can issue an auth challenge and then close the connection .
private void connectTunnel(int connectTimeout, int readTimeout, int writeTimeout, Call call,
      EventListener eventListener) throws IOException {
    Request tunnelRequest = createTunnelRequest();
    HttpUrl url = tunnelRequest.url();
    for (int i = 0; i < MAX_TUNNEL_ATTEMPTS; i++) {
      connectSocket(connectTimeout, readTimeout, call, eventListener);
      tunnelRequest = createTunnel(readTimeout, writeTimeout, tunnelRequest, url);
      if (tunnelRequest == null) break; 
      closeQuietly(rawSocket);
      rawSocket = null;
      sink = null;
      source = null;
      eventListener.connectEnd(call, route.socketAddress(), route.proxy(), null);
    }
  }
private void connectTunnel ( int connectTimeout , int readTimeout , int writeTimeout , Call call , EventListener eventListener ) throws IOException { Request tunnelRequest = createTunnelRequest ( ) ; HttpUrl url = tunnelRequest . url ( ) ; for ( int i = 0 ; i < MAX_TUNNEL_ATTEMPTS ; i ++ ) { connectSocket ( connectTimeout , readTimeout , call , eventListener ) ; tunnelRequest = createTunnel ( readTimeout , writeTimeout , tunnelRequest , url ) ; if ( tunnelRequest == null ) break ; closeQuietly ( rawSocket ) ; rawSocket = null ; sink = null ; source = null ; eventListener . connectEnd ( call , route . socketAddress ( ) , route . proxy ( ) , null ) ; } }
Does all the work to build an HTTPS connection over a proxy tunnel.
Does all the work to build an HTTPS connection over a proxy tunnel .
// Tunnel successfully created. // The proxy decided to close the connection after an auth challenge. We need to create a new // connection, but this time with the auth credentials.