{"id":93638,"date":"2020-04-11T17:48:39","date_gmt":"2020-04-11T09:48:39","guid":{"rendered":"http:\/\/4563.org\/?p=93638"},"modified":"2020-04-11T17:48:39","modified_gmt":"2020-04-11T09:48:39","slug":"netty-%e5%8f%af%e4%bb%a5%e5%ae%9e%e7%8e%b0%e9%95%bf%e8%bf%9e%e6%8e%a5%e7%9a%84-http-%e5%8f%8c%e5%90%91%e9%80%9a%e4%bf%a1%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=93638","title":{"rendered":"netty \u53ef\u4ee5\u5b9e\u73b0\u957f\u8fde\u63a5\u7684 http \u53cc\u5411\u901a\u4fe1\u5417?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  netty \u53ef\u4ee5\u5b9e\u73b0\u957f\u8fde\u63a5\u7684 http \u53cc\u5411\u901a\u4fe1\u5417?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <span><i><\/i> 27<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5927\u6982\u7684\u4e1a\u52a1\u573a\u666f\u662f\u8fd9\u6837: \u670d\u52a1\u961f\u5f00\u542f tcp \u957f\u8fde\u63a5\u670d\u52a1,\u5ba2\u6237\u673a\u53d1\u9001\u5fc3\u8df3\u4fdd\u6301\u957f\u8fde\u63a5<\/p>\n<p>\u5ba2\u6237\u673a\u7684\u76f8\u5173\u4e1a\u52a1\u534f\u8bae\u90fd\u662f http(\u957f\u8fde\u63a5\u65f6\u4e5f\u662f),\u6240\u4ee5\u9700\u8981\u670d\u52a1\u7aef\u80fd\u63a5\u53d7 http \u8bf7\u6c42\u548c http \u54cd\u5e94\u5e76\u6b63\u786e\u89e3\u7801,\u8fd8\u8981\u80fd\u53d1\u9001 http \u8bf7\u6c42,\u4e0d\u8fc7\u4e0d\u9700\u8981\u5173\u5fc3\u8fd4\u56de http \u54cd\u5e94<\/p>\n<p>\u73b0\u5728\u5361\u5728 socket \u7ba1\u9053\u5185\u5904\u7406\u63a5\u6536\u5230\u7684\u6570\u636e\u65f6\u53ea\u80fd\u5904\u7406\u4e00\u79cd,\u6bd4\u5982\u6dfb\u52a0\u4e86 <code>HttpRequestDecoder<\/code> \u7684\u89e3\u7801\u5668\u4e4b\u540e\u5c31\u65e0\u6cd5\u89e3\u7801\u5ba2\u6237\u673a\u8fd4\u56de\u7684 response \u54cd\u5e94\u4e86&#8230;<\/p>\n<p>\u8bf7\u95ee\u6709\u5565\u65b9\u4fbf\u7684\u89e3\u51b3\u529e\u6cd5\u5417?<\/p>\n<p>\u73b0\u5728\u80fd\u60f3\u5230\u7684\u5c31\u662f\u81ea\u5df1\u5b9e\u73b0\u4e00\u4e2a\u5148 request \u89e3\u7801 \u5224\u65ad\u4e00\u4e0b \u5931\u8d25\u7684\u8bdd\u5c31\u6254\u7ed9 response \u89e3\u7801,\u4e0d\u77e5\u9053\u5f00\u9500\u662f\u4e0d\u662f\u6bd4\u8f83\u5927<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>16<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1158945\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuxueli <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             netty http\/tcp \u5747\u652f\u6301\u53cc\u5411\u901a\u8baf\uff0c\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e2a\u5b9e\u73b0\uff1a https:\/\/github.com\/xuxueli\/xxl-rpc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158946\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : BBCCBB <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u662f\u8bf4 websocket \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158947\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xuxueli <br \/>\u662f tcp \u7684\u957f\u8fde\u63a5\u4fdd\u6301\u53cc\u5411\u901a\u4fe1,\u4f46\u662f\u901a\u4fe1\u534f\u8bae\u662f http \u534f\u8bae,\u8bf7\u95ee\u5927\u4f6c\u6709\u89e3\u51b3\u601d\u8def\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158948\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tairan2006 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             HTTP \u5c31\u662f\u77ed\u94fe\u63a5\u554a\u2026\u4f60\u600e\u4e48\u957f\u8fde\u63a5\u7684\uff0cHTTP2\/3 \u4e48                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158949\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : angryfish <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u5ba2\u6237\u7aef\u662f\u6807\u51c6 http1 \u7684\u8bdd\uff0c\u6ca1\u5565\u529e\u6cd5\u3002\u53ea\u80fd\u6536\u5230\u5fc3\u8df3\u7684\u65f6\u5019\uff0c\u628a\u6570\u636e\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u4e0d\u53ef\u80fd\u4e3b\u52a8\u5411\u5ba2\u6237\u7aef\u53d1\u9001\u6570\u636e\u7684\u3002\u9b54\u6539\u7248\u7684 http \u5ba2\u6237\u7aef\uff0c\u53e6\u8bf4\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158950\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : araaaa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u61c2\uff0c\u4e3a\u4ec0\u4e48\u670d\u52a1\u7aef\u9700\u8981\u63a5\u53d7\u54cd\u5e94                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158951\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Malthael <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             **\u73b0\u5728\u5361\u5728 socket \u7ba1\u9053\u5185\u5904\u7406\u63a5\u6536\u5230\u7684\u6570\u636e\u65f6\u53ea\u80fd\u5904\u7406\u4e00\u79cd,\u6bd4\u5982\u6dfb\u52a0\u4e86 HttpRequestDecoder \u7684\u89e3\u7801\u5668\u4e4b\u540e\u5c31\u65e0\u6cd5\u89e3\u7801\u5ba2\u6237\u673a\u8fd4\u56de\u7684 response \u54cd\u5e94\u4e86&#8230;** <\/p>\n<p>\u8fd9\u53e5\u4ec0\u4e48\u610f\u601d\uff0c\u534f\u8bae\u65e2\u8981\u89e3\u6790 tcp \u7684\u5fc3\u8df3\u53c8\u8981\u89e3\u6790 http \uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158952\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Malthael <br \/>\u662f\u8fd9\u6837,\u5ba2\u6237\u673a\u662f\u7b2c\u4e09\u65b9\u7684,\u957f\u77ed\u94fe\u63a5\u90fd\u662f\u7528\u7684 http \u534f\u8bae\u53d1\u9001\u63a5\u6536\u6d88\u606f,\u56e0\u4e3a\u670d\u52a1\u7aef\u8981\u4e3b\u52a8\u4e0b\u53d1\u4e00\u4e9b\u4e1c\u897f,\u5ba2\u6237\u673a\u4e5f\u4f1a\u4e3b\u52a8\u4e0a\u62a5\u4e00\u4e9b\u62a5\u6587,\u6240\u4ee5\u5e0c\u671b\u670d\u52a1\u7aef\u90fd\u80fd\u89e3\u6790\u51fa\u6765<\/p>\n<p>\u6bd4\u5982,\u867d\u7136\u662f tcp \u5fc3\u8df3,\u4f46\u662f\u5ba2\u6237\u673a\u662f\u5305\u88c5\u6210 http \u8bf7\u6c42\u53d1\u9001\u8fc7\u6765\u7684<\/p>\n<p>@araaaa <br \/>\u4e0d\u662f\u63a5\u53d7\u54cd\u5e94,\u4e24\u65b9\u4fdd\u6301 tcp \u957f\u8fde\u63a5\u65f6,\u901a\u4fe1\u7684\u534f\u8bae\u662f http,\u6240\u4ee5\u9700\u8981 request response \u90fd\u80fd\u89e3\u6790                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158953\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhaishunqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @BBCCBB <br \/>\u7eaf\u770b\u6807\u9898\u6211\u4e5f\u89c9\u5f97\u8bf4\u7684\u662f websocket&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158954\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Ariver <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             lz \u4f60\u7684\u7f51\u7edc\u57fa\u7840\u9700\u8981\u52a0\u5f3a\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158955\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yuankui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/github.com\/zhoumengkang\/netty-websocket<br \/>\u6ca1\u8bd5\u8fc7\uff0c\u4e0d\u77e5\u9053\u8fd9\u4e2a\u884c\u4e0d\u884c\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158956\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zhaishunqi <br \/>\u5ba2\u6237\u673a\u662f\u7b2c\u4e09\u65b9\u7684,\u4e0d\u652f\u6301 ws&#8230;.<\/p>\n<p>\u5ba2\u6237\u673a\u53d1\u9001\u7684 tcp \u5fc3\u8df3\u62a5\u6587\u662f\u8fd9\u6837\u7684<br \/>&#8220;`<br \/>DefaultHttpRequest(decodeResult: success, version: HTTP\/1.1)<br \/>POST \/*******\/HeartReportInfo HTTP\/1.1<br \/>Content-Type: application\/json<br \/>Content-Length: 166<br \/>&#8220;`<\/p>\n<p>\u81ea\u4e3b\u4e0a\u62a5\u7684\u4e1a\u52a1\u62a5\u6587\u662f\u8fd9\u6837\u7684<br \/>&#8220;`<br \/>DefaultHttpRequest(decodeResult: success, version: HTTP\/1.1)<br \/>POST \/******\/Verification HTTP\/1.1<br \/>Content-Length: 328196<br \/>Content-Type: text\/plain<br \/>Connection: close<br \/>&#8230;<\/p>\n<p>\u5ba2\u6237\u673a\u80fd\u63a5\u6536\u7684\u4e1a\u52a1\u62a5\u6587\u4e5f\u662f\u7c7b\u4f3c\u7684 http \u8bf7\u6c42<br \/>&#8220;`<\/p>\n<p>@Ariver <br \/>\u613f\u95fb\u5176\u8be6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158957\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yuankui <br \/>\u8fd9\u4e2a\u4e0d\u884c,\u4e09\u65b9\u7684\u5ba2\u6237\u673a\u4e0d\u652f\u6301 ws&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158958\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : VictorFan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             http1.1 \u9ed8\u8ba4\u5c31\u662f\u957f\u8fde\u63a5\u7684\uff0c\u5176\u5b9e\u8bf4\u957f\u8fde\u63a5\u5e94\u8be5\u662f\u6307 TCP \u5c42\u3002\u8bc1\u597d\u6700\u8fd1\u5728\u7814\u7a76\u7f51\u7ba1\u534f\u8bae tr069\uff0c\u80fd\u5b9e\u73b0 http \u53cc\u5411\u901a\u4fe1\u529f\u80fd\uff0c\u53ef\u4ee5\u501f\u9274\u4e00\u4e0b\u5b83\u7684\u673a\u5236\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158959\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazinnnn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6682\u65f6\u59a5\u534f\u4e86,\u5148\u63a7\u5236\u5ba2\u6237\u673a\u7684\u62a5\u6587\u957f\u5ea6(\u5c31\u662f\u5220\u6389\u4e0a\u62a5\u56fe\u7247),\u5148\u89e3\u7801\u6210 string \u5b9e\u73b0\u4e1a\u52a1\u518d\u8bf4&#8230;..<\/p>\n<p>\u53d1\u73b0\u4e86 HttpObjectDecoder \u8fd9\u4e2a\u7c7b,\u4e0d\u8fc7\u662f\u62bd\u8c61\u7c7b,netty \u7684\u51e0\u4e2a\u5b50\u7c7b\u90fd\u76f4\u63a5\u533a\u5206\u4e86 request \u548c response,\u8fd8\u6709\u4e00\u4e2a\u6d41\u4f20\u8f93\u534f\u8bae<\/p>\n<p>\u4e0d\u77e5\u9053\u6709\u6ca1\u6709\u529e\u6cd5\u5b9e\u73b0\u4e00\u4e2a\u80fd\u533a\u5206\u51fa req \u548c resp \u7684 HttpObjectDecoder \u5b50\u7c7b\u6765&#8230;\u62bd\u7a7a\u7814\u7a76\u4e00\u4e0b                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1158960\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xcstream <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             http \u7684\u8bdd\u641c comet \u5173\u952e\u8bcd\u53ef\u4ee5\u627e\u5230\u7b54\u6848                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>netty \u53ef\u4ee5\u5b9e\u73b0\u957f\u8fde\u63a5\u7684 ht&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/93638"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93638"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/93638\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93638"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}