Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

How to Setup a Proxy Server?

A. Configuring a Proxy in System Settings

You can set up a proxy on macOS through system settings or by using a local proxy server.

  • Open System Settings > Network > Wi-Fi or Ethernet.
  • Click Details > Proxies.
  • Enable HTTP Proxy or SOCKS Proxy and enter the server address and port.
  • Click OK and Apply changes.

B. Setting Up a Local Proxy Server (Squid)

  • Install Squid:
  • brew install squid
  • Edit the Squid config file:
  • Changenano /usr/local/etc/squid.conf

    Add:

    http_port 3128
  • Start Squid:
  • sudo brew services start squid
  • Test with:
  • curl -x http://localhost:3128 https://www.google.com

Setting Up a Reverse Proxy

A reverse proxy forwards client requests to backend servers.

A. Using Nginx

  • Install Nginx:
  • brew install nginx
  • Edit the Nginx config file:
  • nano /opt/homebrew/etc/nginx/nginx.conf

    Add:

    server {
        listen 8080;
        location / {
            proxy_pass http://127.0.0.1:5000;
        }
    }
  • Start Nginx:
  • sudo brew services start nginx
  • Open http://localhost:8080 to test.

B. Using Apache

  • Start Apache:
  • sudo apachectl start
  • Enable modules:
  • sudo nano /etc/apache2/httpd.conf

    Uncomment:

    LoadModule proxy_module libexec/apache2/mod_proxy.so
    LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
  • Edit or create a virtual host file:
  • sudo nano /etc/apache2/extra/httpd-vhosts.conf

    Add:

    <VirtualHost *:8080>
        ProxyPass / http://127.0.0.1:5000/
        ProxyPassReverse / http://127.0.0.1:5000/
    </VirtualHost>
  • Restart Apache:
  • sudo apachectl restart

Reversing a Proxy Server

To stop the proxy server:

System Settings: Go to Network > Proxies and disable the proxy.

  • Squid Proxy:
  • sudo brew services stop squid
  • Nginx Reverse Proxy:
  • sudo brew services stop nginx
  • Apache Reverse Proxy:
  • sudo apachectl stop

This will remove the proxy and restore direct network access.

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free