程序的最佳端口是什么?

发布于 2024-08-12 18:02:10 字数 802 浏览 3 评论 0原文

以下哪一个端口最适合用于程序。我正在研究使用仍在开发中的自定义协议。我正在寻找一个几乎每个连接到公共互联网的主机都可以访问的端口(也就是说,每个可以查看网站的主机都可以使用此端口)。三个主要选项是:

其中哪一个最容易通过 Internet 访问,包括所有 ISP、企业防火墙等。

Which of the following ports is the best one to use for a program. I'm working on using a custom protocol still under development. I'm looking for one that will be accessible to virtually every host that is connected to the public Internet (that is, every host that can view websites can use this port). The three main options are:

Which of these is most widely accessible over the Internet, including all ISPs, corporate firewalls, etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一梦等七年七年为一梦 2024-08-19 18:02:10

所有这些端口均由知名服务使用,您不应使用其中任何一个(如果您的产品不是网络服务器或 DNS 服务器)。未经 IANA 注册,不应使用 DCCP 知名端口。如果您的服务在商业上可行或对整个网络有利,请考虑将其注册为较低的端口号:注册过程在 RFC4340 第 19.9 节中定义。

对于实验用途,请使用 1024 到 49151 之间的端口。请记住,即使是这些端口也应该在您的服务“上线”后立即向 IANA 注册。

关于防火墙:您根本无法预测您的服务是否可用于任何网络。即使您使用端口 80,您也可能会遇到进行内容检查的防火墙。

All of those ports are used by well-known services, and you should use none of them (if your product is not a webserver or a DNS server.) DCCP Well Known ports SHOULD NOT be used without IANA registration. If your service is commercially viable or has benefits for the network as a whole, consider registering it for a lower port number: The registration procedure is defined in RFC4340, Section 19.9.

For experimental use, use a port between 1024 and 49151. Remember that even those ports should be registered with the IANA as soon as your service goes "live".

Regarding firewalls: You cannot predict if your service will be available to any network at all. Even if you use port 80, you probably will run against firewalls that do content checking.

白首有我共你 2024-08-19 18:02:10

不是端口 53。在 80 和 443 之间进行选择。如果您的协议看起来足够像 HTTPS,代理会以相同的方式转发它,那么 443 可能是您的最佳选择。

Not port 53. Toss-up between 80 and 443. If you make your protocol look sufficiently like HTTPS that a proxy will forward it the same way, then maybe 443 is your best choice.

你对谁都笑 2024-08-19 18:02:10

由于您指定的所有端口都用于特定的明确指定的协议,因此将它们用于不同的协议是一个非常糟糕的主意。有一个约定,对于一个知名的端口,有一个相应的协议,如果你违反了这个约定,那么至少会造成混乱,最坏的情况是被怀疑不法分子而被封杀。 马丁的回答为您指明了正确的方向。

As all the ports you've nominated are used for particular well-specified protocols, it's a very bad idea to use these for a different protocol. There's a convention that for a well-known port, there's a corresponding protocol, and if you break this convention, then at the least you're going to cause confusion, and at worst be suspected of nefarious intentions and be blocked. Martin's answer points you in the right direction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文