feat: Initial code
This commit is contained in:
97
TESTING.md
Normal file
97
TESTING.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# Testing FireProxy
|
||||
|
||||
This document provides instructions for testing the FireProxy server.
|
||||
|
||||
## Building the Proxy
|
||||
|
||||
First, build the proxy server:
|
||||
|
||||
```bash
|
||||
make clean
|
||||
make
|
||||
```
|
||||
|
||||
## Running the Proxy
|
||||
|
||||
Start the proxy server on port 8080 (or another port of your choice):
|
||||
|
||||
```bash
|
||||
./fireproxy 8080
|
||||
```
|
||||
|
||||
## Testing with a Web Browser
|
||||
|
||||
### Firefox Configuration
|
||||
|
||||
1. Open Firefox and go to Settings
|
||||
2. Search for "proxy" and click on "Settings" in the Network Settings section
|
||||
3. Select "Manual proxy configuration"
|
||||
4. Set HTTP Proxy to "localhost" and Port to "8080"
|
||||
5. Leave other proxy fields empty
|
||||
6. Check "Also use this proxy for HTTPS"
|
||||
7. Click "OK"
|
||||
|
||||
### Chrome Configuration
|
||||
|
||||
1. Open Chrome and go to Settings
|
||||
2. Search for "proxy" and click on "Open your computer's proxy settings"
|
||||
3. 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:
|
||||
|
||||
```bash
|
||||
# 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/
|
||||
```
|
||||
|
||||
## Verifying DoH Functionality
|
||||
|
||||
To verify that your proxy is using the DoH server for DNS resolution:
|
||||
|
||||
1. Run the proxy with increased verbosity (if available)
|
||||
2. In another terminal, monitor the proxy output while making requests
|
||||
3. You should see messages indicating DoH lookups to hnsdoh.com
|
||||
4. The proxy should log the resolved IP addresses
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Connection refused**: Make sure the proxy is running and listening on the configured port
|
||||
2. **DNS resolution failures**: Check your internet connection and access to hnsdoh.com
|
||||
3. **Memory leaks**: For long-running tests, monitor memory usage to ensure proper cleanup
|
||||
|
||||
### Using Network Monitoring Tools
|
||||
|
||||
You can use tools like Wireshark to monitor the traffic:
|
||||
|
||||
```bash
|
||||
# Capture traffic on loopback interface
|
||||
sudo tcpdump -i lo port 8080 -vv
|
||||
```
|
||||
|
||||
## Performance Testing
|
||||
|
||||
For load testing the proxy:
|
||||
|
||||
```bash
|
||||
# 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:
|
||||
|
||||
1. Buffer overflow vulnerabilities using oversized requests
|
||||
2. Handling of malformed HTTP requests
|
||||
3. Proper handling of connection termination
|
||||
Reference in New Issue
Block a user