OkHttpClient okHttpClient = new OkHttpClient.Builder() .addInterceptor(new AddHeaderInterceptor()) .addInterceptor(new ReceivedCookiesInterceptor()) .addNetworkInterceptor(logInterceptor) .connectTimeout(20000L, TimeUnit.MILLISECONDS) .readTimeout(10000L, TimeUnit.MILLISECONDS) .cookieJar(persistentCookieJar) .proxySelector(new ProxySelector() { @Override public List<Proxy> select(URI uri) { return Collections.singletonList(Proxy.NO_PROXY); } @Override public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { } }) .build();
okhttp 防止抓包
最新推荐文章于 2024-05-05 05:19:57 发布