0

I use a proxy named Freegate and it uses 127.0.0.1 by using netstat only connections that I see are like this

TCP 127.0.0.1:8580 127.0.0.1:59118 ESTABLISHED
TCP 127.0.0.1:8580 127.0.0.1:59120 ESTABLISHED

As an example here is a connection between the socket 127.0.0.1:8580 to 127.0.0.1:59118.

To see the actual remote IP I had to use Resource Monitor on Windows.

enter image description here

When I used the Resource Monitor I saw some remote IPs that this app uses.

My questions are:

  • Why this app or apps like this one use 127.0.0.1 instead of using the remote IP directly?
  • How the internals of such apps work?

I mean when I used Netstat command in Windows the only thing that I get was connections between two sockets with the IP address of 127.0.0.1, I don't know how to interpret this from a technical point of view. If you have any resource that could explain the technique that is used here or the keywords to search please let me know.

2 Answers 2

2

The proxy you are using intends that all your communication pass through it.

So, for example, if your browser connects to a website, the path to the website looks like:

browser <-> proxy <-> internet <-> website

The first hop from browser to proxy is done locally, so the proxy listens inside your computer for a connection.

Connecting inside the computer uses localhost which is also known as the reserved IP address 127.0.0.1. This connection method uses direct memory interface and is extremely fast.

The proxy listens on a port. For more information see What is a computer port?

2
  • thanks for your reply, why proxy app does not set the remote proxy server's IP directly in the browser and use the technique to run the server locally on 127.0.0.1:8580 and goes through all this hardship of sending the traffic first to 127.0.0.1 and then making an outside connection to the remote proxy server? is there any technical reason to do so?
    – Sareh
    Commented Mar 25, 2022 at 14:38
  • The proxy receives messages from your browser and forwards them to the internet for you. The router has your public IP address and it can't be transferred.
    – harrymc
    Commented Mar 25, 2022 at 14:40
1

A proxy does nothing by itself. So for the proxy to connect to a host, something else has to happen first: A client has to connect to the proxy and request a connection to whatever target be made.

The proxy is running on your local PC. It appears to be listening for clients on TCP port 8580. Clients on the same PC connect to localhost:8580. The proxy then makes an outbound connection on demand.

There are also some actual loopback connections where the process connects to itself. The purpose of these connections is unknown. They could be used for inter-process communication (IPC) between the proxy process’ threads.

A simple HTTP proxy is the combination of a HTTP server and a HTTP client. The server receives requests (like GET http://www.example.com) and then makes the actual request, relaying the response back to the original client.

Freegate appears to use a peer-to-peer network to anonymize requests, so it won’t connect directly to the target.

4
  • thanks for your reply, why proxy app does not set the remote proxy server's IP directly in the browser and use the technique to run the server locally on 127.0.0.1:8580 and goes through all this hardship of sending the traffic first to 127.0.0.1 and then making an outside connection to the remote proxy server? is there any technical reason to do so?
    – Sareh
    Commented Mar 25, 2022 at 14:38
  • Because there is no (one) remote HTTP proxy. It’s a peer-to-peer anonymization network.
    – Daniel B
    Commented Mar 25, 2022 at 19:12
  • Thank you Daneil, I googled but couldn't find much, could you please provide me a reference or any materials to understand that?
    – Sareh
    Commented Mar 26, 2022 at 6:24
  • I'm not sure what you're expecting or, to put it differently, where exactly you're struggling to understand. How peer-to-peer networking works in general? How Freegate works? How to link the concepts "HTTP proxy" and "peer-to-peer" on an abstract level?
    – Daniel B
    Commented Mar 26, 2022 at 10:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .