Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab1fe9d5 authored by Jason Monk's avatar Jason Monk Committed by Android Git Automerger
Browse files

am fd4cf800: am 90701f1a: Merge "PAC Local Proxy to only receive lo connections" into klp-dev

* commit 'fd4cf800':
  PAC Local Proxy to only receive lo connections
parents 7c4e91b1 fd4cf800
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import com.google.android.collect.Lists;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
@@ -198,9 +199,15 @@ public class ProxyServer extends Thread {

                while (mIsRunning) {
                    try {
                        ProxyConnection parser = new ProxyConnection(serverSocket.accept());
                        Socket socket = serverSocket.accept();
                        // Only receive local connections.
                        if (socket.getInetAddress().isLoopbackAddress()) {
                            ProxyConnection parser = new ProxyConnection(socket);

                            threadExecutor.execute(parser);
                        } else {
                            socket.close();
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }