获取网站的端口号
如何使用程序获取网站的端口号。有什么方法/途径可以用来知道网站的端口号?
或者,如果我知道我的端口号 52970
与 212.58.241.131
这个 IP 连接,我可以知道我的 PC 的端口号所连接的端口号吗?
How can i obtain the port number of a website using a program. Is there any method / way that i can use to know the port number of a website ?
Or, if i know that my port number 52970
is connected with 212.58.241.131
this ip , can i know the port number with which the port number of my PC is connected ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我相信您需要回顾一下端口号的概念。
默认情况下,HTTP 使用端口 80。因此,您访问的单个网站不需要访问任何其他端口。
TCP 和 UDP 端口号
I believe you need to review the concept of port numbers.
By default, HTTP uses port 80. So an individual website you visit won't need access to any other port.
TCP and UDP port numbers
我不确定您在寻找什么,但从 PHP 脚本中您可以通过
$_SERVER["REMOTE_PORT"]
获取客户端用于连接到您的 Web 服务器的端口I am not sure what you are looking for but from a PHP script you can get the port the client uses to connect to your web server with
$_SERVER["REMOTE_PORT"]
http 的端口号是 80,ssl 的端口号是 443。
如果您使用的是 Windows,请启动 cmd 并输入 netstat -a -b 以查看哪个程序连接到何处。
请详细说明或发布您想要实现的目标的示例,因为我不太清楚。
找到远程或服务器端口
€dit:在 php 中,您可以使用或
如果我是对的,您正在寻找远程端口。
http://php.net/manual/en/reserved.variables.server.php
对于 telnet 请看这里:
http://www.geckotribe.com/php-telnet/
The port number for http is port 80 and 443 for ssl.
If you are on windows start up cmd and type netstat -a -b to see what program connects where.
Please elaborate or post an example of what you want to achieve as it's not quite clear to me.
€dit: in php you can find the remote or server port with
or
If I am right, you are looking for the remote port.
http://php.net/manual/en/reserved.variables.server.php
for telnet look here :
http://www.geckotribe.com/php-telnet/
我不确定这是否对您有帮助,但扫描端口的黄金标准必须是 nmap。
http://nmap.org/
您可以扫描特定 IP 地址的开放端口。
I am not sure if this helps you at all but the gold standard for scanning ports has to be nmap.
http://nmap.org/
You can scan open ports for a specific IP address.
'SERVER_PORT'
'REMOTE_PORT'
'SERVER_PORT'
'REMOTE_PORT'