New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何方便的设置http代理 #23
Comments
目前的实现是一个接口对应使用一个OkhttpClient,你说的情况目前不支持。 |
我去查一下你说的这个东西
在2020年09月21日 19:52,六点半起床 写道:
目前的实现是一个接口对应使用一个OkhttpClient,你说的情况目前不支持。
请问下,你这个场景通过proxySelector能解决吗?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
嗯,关于代理相关的东西,我也不是很熟悉,因为我们业务目前没有这方面的需求。只能先麻烦您研究一下使用一个OkhttpClient能否解决上述场景的问题,有问题随时沟通~
…------------------ 原始邮件 ------------------
发件人: "LianjiaTech/retrofit-spring-boot-starter" <notifications@github.com>;
发送时间: 2020年9月21日(星期一) 晚上7:53
收件人: "LianjiaTech/retrofit-spring-boot-starter"<retrofit-spring-boot-starter@noreply.github.com>;
抄送: "陈添明"<chentianming11@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [LianjiaTech/retrofit-spring-boot-starter] 如何方便的设置http代理 (#23)
我去查一下你说的这个东西
在2020年09月21日 19:52,六点半起床 写道:
目前的实现是一个接口对应使用一个OkhttpClient,你说的情况目前不支持。
请问下,你这个场景通过proxySelector能解决吗?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
我看了proxySelector, 要在创建okHttpClient时传入
【目前的实现是一个接口对应使用一个OkhttpClient】 |
这块我确实不太熟悉,可以加群讨论一下。
…------------------ 原始邮件 ------------------
发件人: "LianjiaTech/retrofit-spring-boot-starter" <notifications@github.com>;
发送时间: 2020年9月22日(星期二) 下午3:59
收件人: "LianjiaTech/retrofit-spring-boot-starter"<retrofit-spring-boot-starter@noreply.github.com>;
抄送: "陈添明"<chentianming11@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [LianjiaTech/retrofit-spring-boot-starter] 如何方便的设置http代理 (#23)
我看了proxySelector, 要在创建okHttpClient时传入
OkHttpClient client = new OkHttpClient(); //构造方法 public OkHttpClient() { this(new Builder()); } public Builder() { dispatcher = new Dispatcher(); protocols = DEFAULT_PROTOCOLS; connectionSpecs = DEFAULT_CONNECTION_SPECS; proxySelector = ProxySelector.getDefault(); cookieJar = CookieJar.NO_COOKIES; socketFactory = SocketFactory.getDefault(); hostnameVerifier = OkHostnameVerifier.INSTANCE; certificatePinner = CertificatePinner.DEFAULT; proxyAuthenticator = Authenticator.NONE; authenticator = Authenticator.NONE; connectionPool = new ConnectionPool(); dns = Dns.SYSTEM; followSslRedirects = true; followRedirects = true; retryOnConnectionFailure = true; connectTimeout = 10_000; readTimeout = 10_000; writeTimeout = 10_000; }
【目前的实现是一个接口对应使用一个OkhttpClient】
如果能做到一个接口对应多个okHttpClient,那么目的就可以达到了
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
把rxjava整合一下就更完美了 |
我们项目没用过RxJava,对这块不是很熟悉。兄弟,要不要提个PR支持下?
…---原始邮件---
发件人: "bj大侠"<notifications@github.com>
发送时间: 2020年9月24日(周四) 上午8:49
收件人: "LianjiaTech/retrofit-spring-boot-starter"<retrofit-spring-boot-starter@noreply.github.com>;
抄送: "六点半起床"<chentianming11@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [LianjiaTech/retrofit-spring-boot-starter] 如何方便的设置http代理 (#23)
把rxjava整合一下就更完美了
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@chentianming11 哈哈,我只是个写安卓的,虽然会写java 后台,可是后台那么多大神,我这三脚猫功夫还是不露了~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
说一下场景。我有100个账号要抢购,不知道商家什么时候放库存。用一个账号不停的轮询。发现有库存了,剩下99账号使用Http 代理抢购。每个账号使用的代理地址都不一样。
目前知道要在OkHttpClient里设置代理
有没有方法在调用RetrofitClient之前,传入okHttpClient
The text was updated successfully, but these errors were encountered: