If I read/write to a TCP socket that is on localhost, will that avoid firewalls?
If I want to open a TCP socket between 2 processes on the same computer, will having the server run on loca开发者_Python百科lhost and the client connect on localhost be safe from any firewall intervention?
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.
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.
精彩评论