{"id":600,"date":"2023-09-24T17:01:49","date_gmt":"2023-09-24T09:01:49","guid":{"rendered":"http:\/\/madapapa.com\/wordpress\/?p=600"},"modified":"2023-12-25T18:38:09","modified_gmt":"2023-12-25T10:38:09","slug":"duan-kou-de-xing-gui","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=600","title":{"rendered":"\u7aef\u53e3\u7684\u884c\u89c4"},"content":{"rendered":"<p>\u4e0b\u9762\u7684\u6587\u7ae0\uff0c\u89e3\u51b3\u4e86\u591a\u5e74\u7684\u4e00\u4e2a\u7591\u60d1\uff0c\u7aef\u53e3\u53f7\u7684\u547d\u540d\uff0c\u771f\u7684\u6709\u89c4\u5f8b\u5417\uff1f<\/p>\n<p><a href=\"https:\/\/matt-rickard.com\/de-facto-ports\">De Facto Ports<\/a><\/p>\n<p>Most applications communicate over a TCP or UDP port. Ports 0-1023 are usually privileged and require administrator or superuser access to bind a network socket to an IP with the corresponding port. But anything over 1024 is up for grabs. IANA (Internet Assigned Numbers Authority) can \u201creserve\u201d ports for specific applications \u2014 but this is only a formality; users and applications are free to use whatever port they wish.<\/p>\n<p>So a look at some port numbers (1024+) and how they are used as default ports today, in 2023. There are many lists out there, but this aims to capture a list of protocols actually used in production (and leaves off many one-off ports used for specific games).<\/p>\n<p>Some interesting patterns observed:<\/p>\n<p>Odd-numbered and easy-to-remember ports are usually used for development servers. 3000, 5000, and 9000 are common in all-in-one web frameworks. Applications that have a related privileged application port (e.g., SMTP, DNS) sometimes use a repeated string (e.g., 5353 for Multicast DNS, 3535 for SMTP, or 8080 for a web server). Other than that, it seems like the strategy is to pick a number with low entropy (e.g., Jupyter on 8888) or a completely random one unlikely to cause conflicts (e.g., 25565 for Minecraft).<\/p>\n<p>Odd-numbered and easy-to-remember ports are usually used for development servers. 3000, 5000, and 9000 are common in all-in-one web frameworks. Applications that have a related privileged application port (e.g., SMTP, DNS) sometimes use a repeated string (e.g., 5353 for Multicast DNS, 3535 for SMTP, or 8080 for a web server). Other than that, it seems like the strategy is to pick a number with low entropy (e.g., Jupyter on 8888) or a completely random one unlikely to cause conflicts (e.g., 25565 for Minecraft).<\/p>\n<p>1080 \u2014 SOCK Proxy<br \/>\n2049 \u2014 Network File System (NFS)<br \/>\n2181 \u2014 Apache ZooKeeper<br \/>\n2375 \u2014 Docker REST API (HTTP)<br \/>\n2376 \u2014 Docker REST API (HTTPS)<br \/>\n3000 \u2014 \u201cThe Development Framework Port.\u201d Ruby on Rails uses port 3000 as the default development port for its web server. Node frameworks use this port (e.g., Express.js, Meteor, Create React App, NextJS, SvelteJS, Astro, Remix).<\/p>\n<p>3306 \u2014 MySQL<\/p>\n<p>3478 \u2014 STUN, TURN (NAT Traversal)<\/p>\n<p>4000 \u2014 Phoenix, Jekyll<\/p>\n<p>4001 \u2014 etcd<\/p>\n<p>4200 \u2014 AngularJS<\/p>\n<p>4567 \u2014 Sinatra<\/p>\n<p>5000 \u2014 \u201cThe Other Development Framework Port.\u201d Flask (Python) uses 5000 as the default development port. As does ASP.NET Core.<\/p>\n<p>5222 \u2014 XMPP (Extensible Messaging and Presence Protocol)<\/p>\n<p>5349 \u2014 STUN, TURN over TLS<\/p>\n<p>5353 \u2014 Multicast DNS \u2014 Follows the same pattern as SMTP, occasionally being run on port 3535. Duplicates the privileged port (DNS uses 53).<\/p>\n<p>5432 \u2014 PostgreSQL<\/p>\n<p>5900 \u2014 VNC (using a remote frame buffer, RFB)<\/p>\n<p>6000 \u2014 X11 (over the network). Common to take the display number and add it to 6000 (e.g., DISPLAY 6 would be served over 6006).<\/p>\n<p>6379 \u2014 Redis<\/p>\n<p>6660 \u2014 IRC (Internet Relay Chat)<\/p>\n<p>6881 \u2014 BitTorrent<\/p>\n<p>8000 \u2014 \u201cPython Development Framework Port.\u201d Includes Django and Python 3\u2019s http.server.<\/p>\n<p>8080 \u2014 \u201cThe HTTP web server port.\u201d Like 5353 (Multicast DNS) and 3535 (SMTP), an unprivileged port to run an HTTP webserver.<\/p>\n<p>8333 \u2014 Bitcoin<\/p>\n<p>8888 \u2014 Jupyter Notebook,<\/p>\n<p>8983 \u2014 Apache Solr<\/p>\n<p>9000 \u2014 Used by various applications, but no central theme or extremely well-known application.<\/p>\n<p>25565 \u2014 Minecraft<\/p>\n<p>27017 \u2014 MongoDB<\/p>\n<p>51820 \u2014 WireGuard<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u7684\u6587\u7ae0\uff0c\u89e3\u51b3\u4e86\u591a\u5e74\u7684\u4e00\u4e2a\u7591\u60d1\uff0c\u7aef\u53e3\u53f7\u7684\u547d\u540d\uff0c\u771f\u7684\u6709\u89c4\u5f8b\u5417\uff1f De Facto Ports Most applications communicate over a TCP or UDP port. Ports 0-1023 are usually privileged and require administrator or superuser access to bind a network socket to an IP with the corresponding port. But anything over 1024 is up for grabs. IANA (Internet Assigned Numbers Authority) can \u201creserve\u201d ports for specific applications &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=600\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u7aef\u53e3\u7684\u884c\u89c4<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[50,5],"tags":[],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-canada","category-linux"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=600"}],"version-history":[{"count":2,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":692,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/600\/revisions\/692"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}