req icon indicating copy to clipboard operation
req copied to clipboard

Simple Go HTTP client with Black Magic

Results 105 req issues
Sort by recently updated
recently updated
newest added

市面上很多代理公司都在卖一种轮转代理,即代理proxyURL是固定的,每次连接都会换新的IP地址 使用req库连接代理时,必须开启DisableKeepAlives(),高并发建议每个协程都创建一个新的req client 不然代理IP重复率较高 我目前就是这样做的,如果大家有类似经验,有更好的实践可以分享一下

简单地测试了一下,比resty性能要好一些 resty实例设置一个超时都要加一下锁 ``` // SetTimeout method is used to set a timeout for a request raised by the client. // // client.SetTimeout(1 * time.Minute) // // It can be overridden...

win7就无法运行这个项目了, 好像是出在quic-go上 更高版本以上的golang编译器无法在win7上运行了

使用下面代码创建的客户端, 在并发的时候, 会出现部分请求走到本地的情况: ```golang client := req.C().SetProxyURL("http://localhost:9000").DisableKeepAlives(). SetUserAgent("curl") ``` 我怀疑可能是重试导致的问题, 于是我使用下面的代码可以解决问题: ```golang client := req.C().SetProxyURL("http://localhost:9000").DisableKeepAlives(). SetUserAgent("curl").SetCommonRetryCondition(func(_ *req.Response, _ error) bool { return false }) ```