gpt4 book ai didi

swift - HTTPS 代理到 URLSession

转载 作者:搜寻专家 更新时间:2023-11-01 05:33:48 24 4
gpt4 key购买 nike

我的代码:

init() {
let configuration = URLSessionConfiguration.default
configuration.httpCookieStorage = HTTPCookieStorage.shared
configuration.requestCachePolicy = .reloadIgnoringLocalCacheData
configuration.urlCache = nil
var proxy = [AnyHashable: Any]()
proxy[AnyHashable(kCFNetworkProxiesHTTPSEnable)] = 1
proxy[AnyHashable(kCFNetworkProxiesHTTPSProxy)] = "..."
proxy[AnyHashable(kCFNetworkProxiesHTTPSPort)] = 14283
proxy[AnyHashable(kCFProxyUsernameKey)] = "..."
proxy[AnyHashable(kCFProxyPasswordKey)] = "..."
configuration.connectionProxyDictionary = proxy

当我运行应用程序时,我看到了:

2017-10-25 00:45:44.768947+0500 ... Api[58675:12224660] *** WARNING: CFMachPortSetInvalidationCallBack() called on a CFMachPort with a Mach port (0x3613) which does not have any send rights.  This is not going to work.  Callback function: 0x7fff389e734f
2017-10-25 00:45:44.769328+0500 ... Api[58675:12224660] TIC Read Status [1:0x100f91800]: 1:57
2017-10-25 00:45:44.798125+0500 ... Api[58675:12224660] Task <4EFD78A7-1055-4D1C-9322-D0954B2B3760>.<1> HTTP load failed (error code: 310 [4:-2096])
2017-10-25 00:45:44.798300+0500 ... Api[58675:12224656] Task <4EFD78A7-1055-4D1C-9322-D0954B2B3760>.<1> finished with error - code: 310
URL Session Task Failed: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 310.)
Program ended with exit code: 0

可能是什么问题?

最佳答案

要么用户名和密码不正确,要么提到的端口被任何其他程序使用。重新启动手机并运行此应用程序并再次检查。

关于swift - HTTPS 代理到 URLSession,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46918892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com