{"id":151,"date":"2019-05-10T16:43:45","date_gmt":"2019-05-10T08:43:45","guid":{"rendered":"http:\/\/limitironbox.myds.me\/wordpress\/?p=151"},"modified":"2020-05-22T16:26:09","modified_gmt":"2020-05-22T08:26:09","slug":"how-to-use-netcat-test-tcp-ip-port","status":"publish","type":"post","link":"https:\/\/limitironbox.myds.me\/wordpress\/how-to-use-netcat-test-tcp-ip-port\/","title":{"rendered":"How to use netcat test tcp\/ip port"},"content":{"rendered":"<p>\u7576\u5728telnet\u4e2d\u8f38\u5165\u6587\u5b57\u6642\uff0c\u9810\u8a2d\u60c5\u6cc1\u4e0b\u5b83\u5728Linemode\u4e2d\u904b\u884c\uff0c\u6bcf\u884c\u767c\u9001\u6578\u64da\u5c01\u5305\uff0c\u56e0\u6b64\u53ea\u9700\u6309Enter\u5c07\u547d\u4ee4\u767c\u9001\u5230\u9060\u7aef\u4e3b\u6a5f\u3002<\/p>\n<hr \/>\n<p>To test Telnet in\u00a0<em>Linemode<\/em>, you can run the dummy server to be listening on the local port, e.g. by using\u00a0<code>netcat<\/code>\u00a0(install if needed):<\/p>\n<pre class=\"lang-sh prettyprint prettyprinted\"><code><span class=\"pln\">nc <\/span><span class=\"pun\">-<\/span><span class=\"pln\">vl localhost <\/span><span class=\"lit\">1234<\/span><\/code><\/pre>\n<p>then in another terminal connect to your server by:<\/p>\n<pre class=\"lang-sh prettyprint prettyprinted\"><code><span class=\"pln\">telnet localhost <\/span><span class=\"lit\">1234<\/span><\/code><\/pre>\n<p>and start entering some text to check when the data is received.<\/p>\n<p>Hit\u00a0<kbd>Control<\/kbd>&#8211;<kbd>]<\/kbd>\u00a0(<code>^]<\/code>) and type\u00a0<code>quit<\/code>\u00a0to finish.<\/p>\n<hr \/>\n<p>It is also possible to send data using Bash shell by the following command:<\/p>\n<pre class=\"lang-sh prettyprint prettyprinted\"><code><span class=\"pln\">cat <\/span><span class=\"pun\">&gt;<\/span> <span class=\"pun\">\/<\/span><span class=\"pln\">dev<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">tcp<\/span><span class=\"pun\">\/<\/span><span class=\"lit\">127.0<\/span><span class=\"pun\">.<\/span><span class=\"lit\">0.1<\/span><span class=\"pun\">\/<\/span><span class=\"lit\">1234<\/span><\/code><\/pre>\n<p>then start entering text. When finished, hit\u00a0<kbd>Control<\/kbd>&#8211;<kbd>D<\/kbd>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7576\u5728telnet\u4e2d\u8f38\u5165\u6587\u5b57\u6642\uff0c\u9810\u8a2d\u60c5\u6cc1\u4e0b&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":3,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/posts\/151\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/limitironbox.myds.me\/wordpress\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}