{"id":47048,"date":"2024-10-07T11:01:45","date_gmt":"2024-10-07T03:01:45","guid":{"rendered":"https:\/\/server.hk\/cnblog\/47048\/"},"modified":"2024-10-07T11:01:45","modified_gmt":"2024-10-07T03:01:45","slug":"iis%e7%8b%80%e6%85%8b%e7%a2%bc-426-upgrade-required%ef%bc%88%e9%9c%80%e8%a6%81%e5%8d%87%e7%b4%9a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/47048\/","title":{"rendered":"IIS\u72c0\u614b\u78bc &#8211; 426 Upgrade Required\uff08\u9700\u8981\u5347\u7d1a\uff09"},"content":{"rendered":"<h1 id=\"iis%e7%8b%80%e6%85%8b%e7%a2%bc-426-upgrade-required%ef%bc%88%e9%9c%80%e8%a6%81%e5%8d%87%e7%b4%9a%ef%bc%89-rrHcmudpYb\">IIS\u72c0\u614b\u78bc &#8211; 426 Upgrade Required\uff08\u9700\u8981\u5347\u7d1a\uff09<\/h1>\n<p>\u5728\u7db2\u7d61\u61c9\u7528\u7a0b\u5e8f\u7684\u958b\u767c\u548c\u904b\u884c\u4e2d\uff0cHTTP\u72c0\u614b\u78bc\u626e\u6f14\u8457\u81f3\u95dc\u91cd\u8981\u7684\u89d2\u8272\u3002\u9019\u4e9b\u72c0\u614b\u78bc\u4e0d\u50c5\u80fd\u5920\u5e6b\u52a9\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u4e86\u89e3\u8acb\u6c42\u7684\u7d50\u679c\uff0c\u9084\u80fd\u6307\u5c0e\u7528\u6236\u5982\u4f55\u9032\u4e00\u6b65\u64cd\u4f5c\u3002\u5728\u773e\u591a\u7684HTTP\u72c0\u614b\u78bc\u4e2d\uff0c426 Upgrade Required\uff08\u9700\u8981\u5347\u7d1a\uff09\u662f\u4e00\u500b\u76f8\u5c0d\u5c11\u898b\u4f46\u91cd\u8981\u7684\u72c0\u614b\u78bc\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e00\u72c0\u614b\u78bc\u7684\u542b\u7fa9\u3001\u4f7f\u7528\u5834\u666f\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"426-upgrade-required%e7%9a%84%e5%ae%9a%e7%be%a9-rrHcmudpYb\">426 Upgrade Required\u7684\u5b9a\u7fa9<\/h2>\n<p>HTTP\u72c0\u614b\u78bc426\u8868\u793a\u5ba2\u6236\u7aef\u9700\u8981\u5347\u7d1a\u5176\u8acb\u6c42\u7684\u5354\u8b70\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u5ba2\u6236\u7aef\u4f7f\u7528\u7684\u5354\u8b70\u7248\u672c\u4e0d\u7b26\u5408\u670d\u52d9\u5668\u6240\u8981\u6c42\u7684\u7248\u672c\u6642\u3002\u6839\u64daRFC 2817\u7684\u5b9a\u7fa9\uff0c\u7576\u670d\u52d9\u5668\u5e0c\u671b\u5ba2\u6236\u7aef\u4f7f\u7528\u66f4\u9ad8\u7248\u672c\u7684\u5354\u8b70\uff08\u4f8b\u5982\uff0c\u5f9eHTTP\/1.1\u5347\u7d1a\u5230HTTP\/2\u6216WebSocket\uff09\u6642\uff0c\u6703\u8fd4\u56de\u6b64\u72c0\u614b\u78bc\u3002<\/p>\n<h2 id=\"%e4%bd%bf%e7%94%a8%e5%a0%b4%e6%99%af-rrHcmudpYb\">\u4f7f\u7528\u5834\u666f<\/h2>\n<p>426\u72c0\u614b\u78bc\u901a\u5e38\u51fa\u73fe\u5728\u4ee5\u4e0b\u5e7e\u7a2e\u60c5\u6cc1\u4e2d\uff1a<\/p>\n<ul>\n<li><strong>WebSocket\u9023\u63a5\uff1a<\/strong>\u7576\u5ba2\u6236\u7aef\u5617\u8a66\u5efa\u7acbWebSocket\u9023\u63a5\uff0c\u4f46\u672a\u4f7f\u7528\u6b63\u78ba\u7684\u5347\u7d1a\u8acb\u6c42\u6642\uff0c\u670d\u52d9\u5668\u53ef\u80fd\u6703\u8fd4\u56de426\u72c0\u614b\u78bc\u3002<\/li>\n<li><strong>HTTP\/2\u5354\u8b70\uff1a<\/strong>\u5982\u679c\u670d\u52d9\u5668\u50c5\u652f\u6301HTTP\/2\uff0c\u800c\u5ba2\u6236\u7aef\u4ecd\u5728\u4f7f\u7528HTTP\/1.1\uff0c\u5247\u670d\u52d9\u5668\u53ef\u80fd\u6703\u8981\u6c42\u5ba2\u6236\u7aef\u5347\u7d1a\u5354\u8b70\u3002<\/li>\n<li><strong>API\u8acb\u6c42\uff1a<\/strong>\u67d0\u4e9bAPI\u53ef\u80fd\u8981\u6c42\u4f7f\u7528\u7279\u5b9a\u7684\u5354\u8b70\u7248\u672c\u9032\u884c\u8acb\u6c42\uff0c\u82e5\u5ba2\u6236\u7aef\u672a\u9075\u5faa\uff0c\u5247\u53ef\u80fd\u6703\u8fd4\u56de426\u72c0\u614b\u78bc\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e8%99%95%e7%90%86426%e7%8b%80%e6%85%8b%e7%a2%bc-rrHcmudpYb\">\u5982\u4f55\u8655\u7406426\u72c0\u614b\u78bc<\/h2>\n<p>\u7576\u5ba2\u6236\u7aef\u6536\u5230426\u72c0\u614b\u78bc\u6642\uff0c\u61c9\u8a72\u6839\u64da\u670d\u52d9\u5668\u7684\u8981\u6c42\u9032\u884c\u76f8\u61c9\u7684\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u89e3\u6c7a\u65b9\u6848\uff1a<\/p>\n<ul>\n<li><strong>\u6aa2\u67e5\u8acb\u6c42\u5354\u8b70\uff1a<\/strong>\u78ba\u4fdd\u5ba2\u6236\u7aef\u4f7f\u7528\u7684\u5354\u8b70\u7248\u672c\u7b26\u5408\u670d\u52d9\u5668\u7684\u8981\u6c42\u3002\u5982\u679c\u670d\u52d9\u5668\u8981\u6c42HTTP\/2\uff0c\u5247\u5ba2\u6236\u7aef\u61c9\u8a72\u5347\u7d1a\u5176\u8acb\u6c42\u3002<\/li>\n<li><strong>\u66f4\u65b0\u5ba2\u6236\u7aef\u5eab\uff1a<\/strong>\u5982\u679c\u4f7f\u7528\u7684\u662f\u67d0\u500b\u5eab\u6216\u6846\u67b6\uff0c\u8acb\u6aa2\u67e5\u662f\u5426\u6709\u53ef\u7528\u7684\u66f4\u65b0\uff0c\u9019\u4e9b\u66f4\u65b0\u53ef\u80fd\u5df2\u7d93\u652f\u6301\u6240\u9700\u7684\u5354\u8b70\u7248\u672c\u3002<\/li>\n<li><strong>\u806f\u7e6b\u670d\u52d9\u5668\u7ba1\u7406\u54e1\uff1a<\/strong>\u5982\u679c\u4e0d\u78ba\u5b9a\u5982\u4f55\u5347\u7d1a\u5354\u8b70\uff0c\u5efa\u8b70\u806f\u7e6b\u670d\u52d9\u5668\u7684\u7ba1\u7406\u54e1\u6216\u6280\u8853\u652f\u6301\u4ee5\u7372\u53d6\u5e6b\u52a9\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%af%84%e4%be%8b%e4%bb%a3%e7%a2%bc-rrHcmudpYb\">\u7bc4\u4f8b\u4ee3\u78bc<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5728JavaScript\u4e2d\u4f7f\u7528WebSocket\u9032\u884c\u9023\u63a5\uff0c\u4e26\u8655\u7406426\u72c0\u614b\u78bc\uff1a<\/p>\n<pre><code>\nconst socket = new WebSocket('ws:\/\/example.com\/socket');\n\nsocket.onopen = function(event) {\n    console.log('WebSocket is open now.');\n};\n\nsocket.onerror = function(error) {\n    console.error('WebSocket Error: ', error);\n};\n\nsocket.onclose = function(event) {\n    if (event.code === 426) {\n        console.log('\u9700\u8981\u5347\u7d1a\u5354\u8b70\uff0c\u8acb\u6aa2\u67e5\u60a8\u7684\u8acb\u6c42\u3002');\n    } else {\n        console.log('WebSocket is closed now.');\n    }\n};\n<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-rrHcmudpYb\">\u7e3d\u7d50<\/h2>\n<p>HTTP\u72c0\u614b\u78bc426 Upgrade Required\uff08\u9700\u8981\u5347\u7d1a\uff09\u662f\u4e00\u500b\u91cd\u8981\u7684\u6307\u793a\uff0c\u544a\u8a34\u5ba2\u6236\u7aef\u9700\u8981\u5347\u7d1a\u5176\u8acb\u6c42\u7684\u5354\u8b70\u3002\u4e86\u89e3\u9019\u4e00\u72c0\u614b\u78bc\u7684\u542b\u7fa9\u53ca\u5176\u4f7f\u7528\u5834\u666f\uff0c\u80fd\u5920\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u6709\u6548\u5730\u8655\u7406\u7db2\u7d61\u8acb\u6c42\u3002\u5728\u9762\u5c0d426\u72c0\u614b\u78bc\u6642\uff0c\u5ba2\u6236\u7aef\u61c9\u8a72\u6aa2\u67e5\u5176\u8acb\u6c42\u5354\u8b70\uff0c\u5fc5\u8981\u6642\u9032\u884c\u5347\u7d1a\uff0c\u4ee5\u78ba\u4fdd\u8207\u670d\u52d9\u5668\u7684\u6b63\u5e38\u901a\u4fe1\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u7684\u7528\u6236\u3002\u7121\u8ad6\u662f <a href=\"https:\/\/server.hk\">\u4e91\u4f3a\u670d\u5668<\/a> \u9084\u662f <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\uff0c\u6211\u5011\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3IIS\u72c0\u614b\u78bc426 Upgrade Required\uff0c\u8a72\u78bc\u8868\u793a\u5ba2\u6236\u7aef\u9700\u5347\u7d1a\u5354\u8b70\u4ee5\u7e7c\u7e8c\u8acb\u6c42\uff0c\u78ba\u4fdd\u9023\u63a5\u7684\u5b89\u5168\u6027\u548c\u517c\u5bb9\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-47048","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=47048"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47048\/revisions"}],"predecessor-version":[{"id":47049,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47048\/revisions\/47049"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=47048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=47048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=47048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}