views:

47

answers:

3

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?

+1  A: 

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!-).

Alex Martelli
+1  A: 

It depends on the implementation of the firewall, so, yes, there could be firewall intervention.

WhirlWind
IPTables on Linux, for instance, can regulate traffic on the loopback interface (that is, traffic that never leaves the local host).
David Zaslavsky
A: 

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.

Hotei