对于非 http 使用端口 80
是否可以将端口 80 用于非 http 流量?例如,我正在制作一个小脚本,它将通过互联网与朋友的计算机进行通信,但是他们必须将其端口转发才能通过路由器。在脚本中使用端口 80 是否有问题,因此它会自动通过?是否有某些部分我不明白,不会让非 http 数据通过?请解释一下:)
Is it possible to use port 80 for non http traffic ? For example I'm making a small script that will communicate with a friends computer through the internet, however they must port forward it to get past the router. Is there a problem with using port 80 in the script so it will be let through automatically ? Is there some part of this i don't understand that will not let non http data through ? Please explain :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这样做没有问题。事实上,Skype的默认行为是使用端口80和端口443来传输语音!
there is no problem doing that. in fact, skype's default behaviour is to use port 80 and port 443 to transport voice!
有很多 ISP 实际上会阻止端口 80,因此如果遇到问题(仍然需要转发),您可能需要尝试不同的端口。
计算机上的防火墙还需要设置为允许传入流量。
There are a lot of ISPs that actually block port 80, so you might want to try a different port if you are having a problem (still needs to be forwarded)
The firewall on the computer also needs to be set to allow the incoming traffic.
这可以正常工作,但您的朋友可能仍需要设置端口转发
如果您朋友的 PC 正在侦听端口 80,则他将需要设置端口转发。否则,路由器/NAT 如何知道将连接桥接到家里的哪台计算机?
但是,如果您朋友的 PC 是进行出站连接的 PC,那么他这一端可能根本不需要端口转发。
换句话说,端口转发(对于 TCP)仅适用于入站连接。路由器/NAT 将自动为出站连接设置端口映射方案(就像它对所有网络流量所做的那样)。
This will work fine, but your friend may still need to setup port forwarding
If your friend's PC is the one listening on Port 80, he will need to setup port forwarding. Otherwise, how would the router/NAT know which computer in the house to bridge the connection to?
But if your friend's PC is the one making the outbound connection, then likely no port forwarding is needed at all on his end.
In other words, port forwarding (for TCP) is only for inbound connections. The router/NAT will automatically setup a port mapping scheme for outbound connections (as it does it with all web traffic).