{"id":430049,"date":"2021-04-18T10:18:44","date_gmt":"2021-04-18T02:18:44","guid":{"rendered":"http:\/\/4563.org\/?p=430049"},"modified":"2021-04-18T10:18:44","modified_gmt":"2021-04-18T02:18:44","slug":"%e6%9c%8d%e5%8a%a1%e7%bb%91%e5%ae%9a%e5%88%b0-0-0-0-0-%e7%9a%84%e8%af%9d%ef%bc%8c%e6%9c%89%e4%bb%80%e4%b9%88%e5%8a%9e%e6%b3%95%e8%87%aa%e5%8a%a8%e8%8e%b7%e5%8f%96%e5%88%b0%e5%85%b6%e4%bb%96%e4%ba%ba","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=430049","title":{"rendered":"\u670d\u52a1\u7ed1\u5b9a\u5230 0.0.0.0 \u7684\u8bdd\uff0c\u6709\u4ec0\u4e48\u529e\u6cd5\u81ea\u52a8\u83b7\u53d6\u5230\u5176\u4ed6\u4eba\u53ef\u4ee5\u63a5\u5165\u7684 IP \u5730\u5740\u5417\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u670d\u52a1\u7ed1\u5b9a\u5230 0.0.0.0 \u7684\u8bdd\uff0c\u6709\u4ec0\u4e48\u529e\u6cd5\u81ea\u52a8\u83b7\u53d6\u5230\u5176\u4ed6\u4eba\u53ef\u4ee5\u63a5\u5165\u7684 IP \u5730\u5740\u5417\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5982\u9898\uff0c\u60f3\u8981\u505a\u4e00\u79cd\u4f7f\u7528\u573a\u666f\u662f\uff0c\u6211\u5f00\u4e86\u4e00\u4e2a\u670d\u52a1\u8fdb\u7a0b\uff0c\u5229\u7528 tcp \u4e0e\u5ba2\u6237\u7aef\u901a\u4fe1\u3002<\/p>\n<p>\u5f53\u7136\u7406\u8bba\u60c5\u51b5\u4e0b\u662f\u53ef\u4ee5\u7531\u7528\u6237\u8bbe\u5b9a\u597d\u8fd9\u4e2a\u670d\u52a1\u7ed1\u5b9a\u5230\u6bd4\u5982\u54ea\u4e2a IP \u7684\u54ea\u4e2a\u7aef\u53e3\uff0c\u4f46\u662f\u8fd8\u60f3\u8981\u505a\u4e00\u79cd\u529f\u80fd\u662f\u4e0d\u7528\u7528\u6237\u8bbe\u7f6e\uff0c\u76f4\u63a5\u7ed1\u5b9a\u5230 0.0.0.0 \u5e76\u968f\u610f\u9009\u62e9\u4e00\u4e2a\u7aef\u53e3\uff0c\u7136\u540e\u5728\u670d\u52a1\u7ed1\u5b9a\u597d\u4e4b\u540e\u518d\u901a\u77e5\u5ba2\u6237\u7aef\u8bf4\u6211\u7ed1\u5b9a\u5230\u54ea\u91cc\u4e86\uff0c\u5982\u679c\u8fd9\u6837\u7684\u8bdd\uff0c\u90a3\u5c31\u53ef\u4ee5\u968f\u610f\u5f00\u5173\u4efb\u610f\u6570\u91cf\u7684\u670d\u52a1\u7aef\u800c\u4e0d\u7528\u8003\u8651\u63a5\u53e3\u5730\u5740\u7684\u8bbe\u7f6e\u95ee\u9898\u3002<\/p>\n<p>========<\/p>\n<p>\u76ee\u524d\u7aef\u53e3\u95ee\u9898\u6bd4\u8f83\u597d\u641e\u5b9a\uff0c\u6bd4\u5982\u7528\u6237\u7ed1\u5b9a\u5230 127.0.0.1:0\uff0c\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\u4e00\u4e2a\u7aef\u53e3\uff0c\u7ed1\u5b9a\u540e\u518d\u83b7\u53d6\u5c31\u786e\u5b9a\u597d\u4f4d\u7f6e\u4e86\u3002\u4f46\u662f IP \u7684\u8bdd\u5982\u679c\u7ed1\u5b9a\u5230 0.0.0.0 \u5219\u6ca1\u6cd5\u7528\u7c7b\u4f3c\u903b\u8f91\u3002<\/p>\n<p>\u4e0d\u592a\u4f18\u96c5\u7684\u65b9\u6cd5\u4f3c\u4e4e\u662f\u8bf7\u6c42\u7f51\u5361\u4e0a\u90fd\u6709\u54ea\u4e9b\u5730\u5740\uff1f\u611f\u89c9\u4e0d\u592a\u597d\uff0c\u8fd8\u6709\u4f18\u96c5\u4e00\u4e9b\u7684\u89e3\u51b3\u65b9\u6848\u5417\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5660325\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : opengps <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u7684\u505a\u6cd5\uff1a<br \/>1\uff0c\u670d\u52a1\u5668\u7a0b\u5e8f\u7ed1\u5b9a 0.0.0.0\uff0c\u4e3a\u4e86\u517c\u5bb9\u6240\u6709\u7f51\u5361\u90fd\u80fd\u901a\u4fe1\uff0c\u5bf9\u5916\u7f51\u5c31\u53ef\u4ee5\u53ea\u63d0\u4f9b\u4e00\u4e2a\u7aef\u53e3\u5373\u53ef\uff0c\u65e0\u8bba\u53d1\u5e03\u5728\u4ec0\u4e48\u7f51\u7edc\u7ed3\u6784\u4e0b<br \/>2\uff0c\u670d\u52a1\u5668\u8bfb\u53d6\u4e0b\u672c\u5730\u6240\u6709\u7f51\u5361\u7684 ip\uff0c\u6784\u9020\u4e00\u4e2a list \u5b58\u50a8\u6240\u6709 ipv4 \u7684\u5730\u5740\uff0c\u5b58\u5230\u5171\u4eab\u7f13\u5b58\u91cc\uff0c\u7528\u6765\u5185\u90e8\u76f4\u8fde\u901a\u4fe1\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660326\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ClericPy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u672c\u6765\u70b9\u8fdb\u6765\u4ee5\u524d\u4ee5\u4e3a\u4f1a\u804a\u670d\u52a1\u53d1\u73b0\u6216\u8005\u53cd\u5411\u4ee3\u7406&#8230; \u4f60\u8fd9\u4e2a\u4f3c\u4e4e\u5c31\u662f\u60f3\u628a\u516c\u7f51 IP \u53d1\u7ed9\u5ba2\u6237\u7aef\u8ba9\u4ed6\u8bbf\u95ee? \u9632\u706b\u5899\u5982\u679c\u5df2\u7ecf\u5f00\u4e86\u516c\u7f51\u7aef\u53e3\u7684\u8bdd, \u968f\u4fbf\u6253\u4e2a\u67e5\u770b IP \u7684\u7f51\u5740\u53ef\u4ee5\u4e0d? \u9664\u4e86 ipip \u4ec0\u4e48\u7684, \u6211\u5076\u5c14\u4f1a\u7528 httpbin.org\/get \u91cc\u9762\u7ed9\u6211\u7684 IP                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660327\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @opengps <br \/>@ClericPy \u7406\u8bba\u4e0a\u786e\u5b9e\u662f\u60f3\u5b9e\u73b0\u201c\u8ba9\u522b\u4eba\u53d1\u73b0\u6211\u6b63\u5728\u63d0\u4f9b\u670d\u52a1\u201d\u8fd9\u4e2a\u529f\u80fd\u3002\u6bd4\u5982\u8bbe\u8ba1\u4e00\u4e2a\u7b80\u5355\u7684\u4f7f\u7528\u573a\u666f\uff0c\u5728\u4e00\u4e2a\u591a\u8fdb\u7a0b\u57fa\u4e8e tcp \u7684\u901a\u4fe1\u4e2d\uff0c\u6211\u73b0\u5728\u6709\u4e00\u4e2a\u56fa\u5b9a\u7684\u4e2d\u5fc3\u670d\u52a1\u5668\uff0c\u6bd4\u5982\u7ed1\u5b9a\u5230 center.service.com:443\uff0c\u6211\u60f3\u5b9e\u73b0\u7684\u6548\u679c\u662f\u6bcf\u4e2a\u670d\u52a1\u5668\uff0c\u5373\u4f7f\u5728\u4e0d\u540c\u7684\u673a\u5668\u4e2d\uff0c\u53ea\u9700\u8981\u8fd0\u884c server = center.connect()\u5c31\u53ef\u4ee5\u544a\u77e5\u76ee\u524d\u5728\u7ebf\u7684\u6240\u6709\u4eba\u8fde\u63a5\u6211\u8fd9\u4e2a\u670d\u52a1\u7684\u65b9\u5f0f\u3002<\/p>\n<p>\u7406\u8bba\u4e0a\u51e0\u79cd\u505a\u6cd5\uff0c\u4e00\u79cd\u662f\u7531\u4e8e\u5927\u5bb6\u90fd\u548c center \u6709\u8fde\u63a5\uff0c\u6240\u6709\u6d41\u91cf\u90fd\u7ecf\u7531 center \u4ee3\u7406\uff0c\u8fd9\u79cd\u5728\u591a\u8282\u70b9\u901a\u4fe1\u60c5\u51b5\u4e0b\u6548\u7387\u592a\u4f4e\uff0c\u4e0d\u4f5c\u8003\u8651\u3002\u53e6\u4e00\u79cd\u662f\u7531\u670d\u52a1\u7aef\u4e0a\u7ebf\u65f6\u81ea\u5df1\u8bbe\u5b9a\u597d\uff0c\u6bd4\u5982 server = center.connect(my_ip=&#8217;192.168.0.100&#8242;)\uff0c\u7136\u540e\u7ed1\u5b9a\u670d\u52a1\u5230\u8fd9\u4e2a IP\uff0c\u8fd9\u4e2a\u611f\u89c9\u53c8\u592a\u9ebb\u70e6\u4e86\uff0c\u7406\u60f3\u7684\u60c5\u51b5\u4e0b\u5c31\u662f server \u4e0d\u7528\u8fdb\u884c\u4efb\u4f55\u8bbe\u7f6e\u76f4\u63a5\u542f\u52a8\uff0c\u7136\u540e\u81ea\u52a8\u7ed1\u5b9a 0.0.0.0 \u7684\u67d0\u4e2a\u7aef\u53e3\uff0c\u5e76\u4e14\u81ea\u52a8\u83b7\u53d6\u5230\u5176\u4ed6\u4eba\u8bbf\u95ee\u54ea\u4e2a IP \u53ef\u4ee5\u7ecf\u7531 0.0.0.0 \u8f6c\u63a5\u3002<\/p>\n<p>\u53ef\u80fd\u8bf4\u7684\u4e0d\u592a\u6e05\u695a\uff0c\u9700\u6c42\u6bd4\u8f83\u602a\uff0c\u4e24\u4f4d\u89c1\u8c05\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660328\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jim9606 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             bind \u4f7f\u7528\u672a\u6307\u5b9a\u5730\u5740\u5c31\u662f\u4e3a\u4e86\u7ed1\u5b9a\u5230\u6240\u6709 link \u4e0a\u3002<br \/>\u5982\u679c\u5e0c\u671b\u77e5\u9053\u6709\u54ea\u4e9b\u5730\u5740\u7684\u8bdd\u8c03\u7528 ip -j link \uff08 json \u8f93\u51fa\uff0c\u4f9d\u8d56 iproute2 \u5b9e\u7528\u5de5\u5177\uff09\uff0c\u89c9\u5f97\u4e0d\u4f18\u96c5\u7684\u4e5f\u53ef\u4ee5\u7528 libnl \u8bfb\u53d6\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660329\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jim9606 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4f60\u8fd9\u4e2a\u5e94\u7528\u7684\u5168\u5728\u4e00\u4e2a\u5c40\u57df\u7f51\u7684\u8bdd\uff0c\u53ef\u4ee5\u8003\u8651\u7528 mDNS \u53d1\u5e03\u4e00\u4e2a service(DNS SRV \u8bb0\u5f55)\uff0c\u4f8b\u5982\u8fd9\u6837\uff1a<br \/>avahi-publish-service center _myapp._tcp 5666 parm1=val1 parm2=val2<\/p>\n<p>\u5176\u4ed6\u7aef\u70b9\u7528\u652f\u6301 mDNS \u7684\u67e5\u8be2\u5668\u67e5\u8be2\u8fd9\u4e2a SRV \u8bb0\u5f55\uff1a<br \/>avahi-browse -r _myapp._tcp                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660330\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zachlhb <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u611f\u89c9\u4f60\u8981\u4e0a\u670d\u52a1\u53d1\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660331\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DCjanus <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u641c\u7d22 stun \u5c31\u53ef\u4ee5\u4e86\uff0c\u611f\u89c9\u5c31\u662f\u5e38\u89c1\u7684 P2P \u573a\u666f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660332\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ho121 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7aef\u53e3\u8f6c\u53d1\u8981\u8003\u8651\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660333\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pursuer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u4ec0\u4e48 \u201c\u8bf7\u6c42\u7f51\u5361\u4e0a\u7684\u5730\u5740\u201d\u662f\u4e0d\u592a\u4f18\u96c5\u7684\u65b9\u6cd5\uff1f\u6211\u89c9\u5f97\u662f\u633a\u6b63\u5e38\u7684\u65b9\u6cd5<\/p>\n<p>\u5982\u679c\u8981\u53bb\u4e2d\u6027\u5316\u7684\u65b9\u6848\uff0c\u5e76\u4e14\u662f\u5728\u5c40\u57df\u7f51\u5185\uff0c\u53ef\u4ee5\u4f7f\u7528\u7ec4\u64ad\u534f\u8bae                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660334\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u89e3\u51b3\u65b9\u6848\u5e94\u5f53\u548c\u7f51\u7edc\u62d3\u6251\u6709\u5173\uff0c\u5982\u679c\u4f60\u6240\u6709\u94fe\u63a5\u90fd\u662f N \u5c42 NAT \u90a3\u5929\u795e\u96be\u6551\u3002<br \/>\u6240\u6709\u673a\u5668\u7684\u63a5\u53e3 IP \u90fd\u662f\u76f8\u4e92\u53ef\u89c1\u7684\u8bdd\uff0c\u76f4\u63a5\u62ff\u672c\u673a IP \u63a5\u53e3\u5c31\u884c\uff1b\u5982\u679c\u6709\u865a\u62df\u7f51\u7edc\u63a5\u53e3\u4f1a\u5bfc\u81f4\u6df7\u6dc6\uff0c\u5927\u6982\u4e5f\u9700\u8981\u5206\u8fa8\u4e00\u4e0b\u865a\u62df\u63a5\u53e3\u548c\u771f\u5b9e\u63a5\u53e3\u3002<br \/>\u6216\u8005\u8ba9\u4e2d\u5fc3\u670d\u52a1\u5668\u53bb\u7406\u89e3\u8c01 connect \u8fdb\u6765\u4e86\uff0ccenter \u62ff src \u5f53\u9ed8\u8ba4\u670d\u52a1\u63d0\u4f9b\u70b9\uff1b\u5982\u679c\u5230 center \u6709 NAT \u5c31\u4e0d\u884c\u4e86\u3002<br \/>\u518d\u89e3\u9664\u66f4\u591a\u5047\u8bbe\uff0c\u5c31\u4f1a\u8ddf P2P \u7ec4\u7f51\u4ea7\u751f\u7c7b\u4f3c\u7684\u60c5\u51b5\u4e86\uff0c\u4e0d\u5982\u76f4\u63a5\u641e\u4e2a P2P \u7ec4\u7f51\u8bbe\u7f6e\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660335\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : LeeReamond <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pursuer \u56e0\u4e3a\u53d1\u5728 py \u4e13\u533a\uff0cpy \u4f3c\u4e4e\u662f\u6ca1\u6709\u6807\u51c6\u5e93\u5b9e\u73b0\uff0c\u8981\u8de8\u8fdb\u7a0b\u8c03\u7528\u7684\u8bdd\u4f3c\u4e4e\u5c31\u4e0d\u90a3\u4e48\u4f18\u96c5\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660336\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ipwx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @LeeReamond \u7528 python \u53ef\u4ee5\u554a\uff0c\u7ed1\u5b9a\u5230 0.0.0.0:0 \u5c31\u884c\u4e86\u3002<\/p>\n<p>https:\/\/imgur.com\/cGZgvhx                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660337\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pursuer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @LeeReamond <br \/>python \u4f5c\u4e3a\u80f6\u6c34\u8bed\u8a00\uff0c\u7f3a\u5565\u52a0\u5565\u4e5f\u662f\u6b63\u5e38\u7684\uff0c\u53ef\u4ee5\u8bd5\u8bd5\u4e2a pyuv<br \/>import pyuv<br \/>pyuv.util.interface_addresses()<br \/>\u5c31\u53ef\u4ee5\u8bfb ip \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u670d\u52a1\u7ed1\u5b9a\u5230 0.0.0.0 \u7684\u8bdd\uff0c&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\/430049"}],"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=430049"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/430049\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430049"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}