如果我读/写本地主机上的 TCP 套接字,是否可以避开防火墙?
如果我想在同一台计算机上的两个进程之间打开 TCP 套接字,让服务器在本地主机上运行并且客户端在本地主机上连接是否可以免受任何防火墙干预?
If I want to open a TCP socket between 2 processes on the same computer, will having the server run on localhost and the client connect on localhost be safe from any firewall intervention?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一些防火墙在这个问题上过于热心——这就是为什么 IDLE(Python 捆绑 IDE,它与本地主机套接字上的子程序对话)会发出警告并提供命令行选项来避免这种麻烦(不幸的是,它主要发生在 Windows 上) ,因此 Unix 域套接字不是 TCP 套接字的可行替代方案!-)。
Some firewalls are overzealous in this matter -- which is why IDLE (the Python bundled IDE which talks to children-programs on a localhost socket) warns about it and offers a command line option to avoid this bother (unfortunately, it mostly happens on Windows, so Unix-domain sockets are not a viable alternative to TCP sockets!-).
这取决于防火墙的实施,所以,是的,可能会有防火墙干预。
It depends on the implementation of the firewall, so, yes, there could be firewall intervention.
在我熟悉的系统上,此请求永远不会“在线”,因此您拥有的任何外部防火墙都不会进入该画面,因为该请求根本不会发送到 NIC。我不能说基于主机的防火墙如何与其交互,因为这太依赖于防火墙的实现方式。
On systems I'm familiar with this request will never get "on the wire" so any external firewall you have is not going to enter the picture because the request never goes to the NIC at all. I can't say how a host-based firewall would interact with it as that's way too dependent on how the firewall is implemented.