菜鸟教程小白 发表于 2022-12-13 10:55:43

ios - 我可以在使用 NSURLSession 的 iOS 应用程序中关闭 SPDY 吗?


                                            <p><p>我的 iOS 应用在从启用了 SPDY 的 HTTPS nginx Web 服务器加载图像时出现网络问题。此处描述了该问题:<a href="https://stackoverflow.com/questions/32493339/sending-400-https-spdy-requests-result-in-the-request-timed-out-errors-with-n" rel="noreferrer noopener nofollow">Sending SPDY requests results in &#34;The request timed out&#34; errors with NSUrlSession in iOS</a> </p>

<p>我将 NSURLSession 用于我的网络。我做了实验并确认如果我在服务器端关闭 SPDY,我的问题就得到了解决。不幸的是,我无法在生产 nginx 服务器上关闭 SPDY,因为我无法控制它。我可以在 iOS 应用中关闭 SPDY 吗?</p>

<p>OS X:10.10.4 (14E46),iOS:8 和 9,Xcode:7.0 (7A218),nginx:1.9.4</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您<em>可能</em>能够使用 nginx 将作为非 SPDY、非 HTTP/2 请求处理的内容预先填充 NSURLRequest 中的 Upgradeheader 字段,例如</p>

<p>升级:TLS/1.2</p>

<p>但是 URL 加载系统可能只是踩它,在这种情况下,禁用它的唯一方法是配置服务器以比较用户代理字符串(或您提供的任何其他 header )并拒绝升级连接。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 我可以在使用 NSURLSession 的 iOS 应用程序中关闭 SPDY 吗?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/32598410/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/32598410/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 我可以在使用 NSURLSession 的 iOS 应用程序中关闭 SPDY 吗?