4.4 KiB
Testing FireProxy
This document provides instructions for testing the FireProxy server.
Building the Proxy
First, build the proxy server:
make clean
make
Running the Proxy
Start the proxy server on port 8080 (or another port of your choice):
./fireproxy 8080
Testing with a Web Browser
Firefox Configuration
- Open Firefox and go to Settings
- Search for "proxy" and click on "Settings" in the Network Settings section
- Select "Manual proxy configuration"
- Set HTTP Proxy to "localhost" and Port to "8080"
- Leave other proxy fields empty
- Check "Also use this proxy for HTTPS"
- Click "OK"
Chrome Configuration
- Open Chrome and go to Settings
- Search for "proxy" and click on "Open your computer's proxy settings"
- Enable proxy settings according to your operating system:
- Windows: Set the HTTP proxy to "localhost:8080"
- macOS: Set the Web Proxy (HTTP) to "localhost" with port "8080"
- Linux: Set the HTTP proxy to "localhost" with port "8080"
Testing with cURL
You can use cURL to test your proxy:
# Test HTTP request through proxy
curl -v --proxy http://localhost:8080 http://example.com/
# Test HTTPS request through proxy (if supported)
curl -v --proxy http://localhost:8080 https://example.com/
HTTPS Support
The proxy now correctly supports HTTPS connections through the HTTP CONNECT method. When using HTTPS:
- The browser establishes a tunnel through the proxy to the destination server
- The proxy resolves the hostname using DoH
- All traffic is forwarded between the client and server without modification
For secure browsing, you must:
- Configure your browser to trust the connection (you may see certificate warnings)
- Make sure your proxy settings are applied to both HTTP and HTTPS traffic
Verifying HTTPS Support
To verify HTTPS support is working:
- Configure your browser to use the proxy
- Visit an HTTPS site like https://example.com
- Check the proxy logs for CONNECT requests
- You should see messages like:
Proxying request to: example.com (port 443) DoH response received, size: XXX bytes Resolved example.com to XXX.XXX.XXX.XXX
If you see certificate warnings, this is normal - your browser is correctly verifying the security of the connection.
Verifying DoH Functionality
To verify that your proxy is using the DoH server for DNS resolution:
- Run the proxy with increased verbosity (if available)
- In another terminal, monitor the proxy output while making requests
- You should see messages indicating DoH lookups to hnsdoh.com
- The proxy should log the resolved IP addresses
Troubleshooting
Common Issues
- Connection refused: Make sure the proxy is running and listening on the configured port
- DNS resolution failures: Check your internet connection and access to hnsdoh.com
- Memory leaks: For long-running tests, monitor memory usage to ensure proper cleanup
HTTP and HTTPS Troubleshooting
If only HTTPS or only HTTP is working:
HTTP Issues
- Ensure correct Host header extraction in HTTP requests
- Try a simple curl command:
curl -v --proxy http://localhost:8080 http://example.com/ - Check proxy logs for any HTTP-specific errors
- Verify that the proxy correctly forwards the entire HTTP request, including all headers
HTTPS Issues
- HTTPS uses the CONNECT method which creates a tunnel without modifying content
- Try a simple curl command:
curl -v --proxy http://localhost:8080 https://example.com/ - Certificate warnings are expected and don't indicate proxy failure
- Ensure your browser's security settings allow connecting through the proxy
Common Fix for Both
If either HTTP or HTTPS isn't working, you can restart the proxy server and try again with verbose logging enabled.
Using Network Monitoring Tools
You can use tools like Wireshark to monitor the traffic:
# Capture traffic on loopback interface
sudo tcpdump -i lo port 8080 -vv
Performance Testing
For load testing the proxy:
# Install Apache Bench (ab) if not already installed
# Then test with multiple concurrent connections
ab -n 1000 -c 10 -X localhost:8080 http://example.com/
Security Testing
Since your proxy handles web traffic, consider testing for:
- Buffer overflow vulnerabilities using oversized requests
- Handling of malformed HTTP requests
- Proper handling of connection termination