A lightweight and efficient proxy server implementation in C, supporting both Linux and Windows platforms. This proxy server can handle HTTP/HTTPS requests and includes features like request logging, SSL/TLS support, and configurable port settings.
04_Finalize/
├── Linux/
│ ├── proxy.c # Main proxy server source code
│ ├── server.crt # SSL certificate
│ ├── server.key # SSL private key
│ └── proxy_log.txt # Log file
└── windows/
├── WinProxy.c # Windows-specific proxy server code
├── proxy.exe # Compiled Windows executable
└── proxy_log.txt # Log file
- GCC compiler
- OpenSSL development libraries
- Make build system
- MinGW-w64 or MSVC compiler
- OpenSSL development libraries
- Windows 10 or later
-
Navigate to the Linux directory:
cd Linux -
Compile the proxy server:
gcc -o proxy_server proxy.c -lssl -lcrypto
-
Run the proxy server:
./proxy_server
-
To run in the background:
./proxy_server &
The server will start on port 8080 by default. You can configure your browser to use this proxy server by setting:
- Proxy address: 127.0.0.1
- Port: 8080
For Firefox:
- Go to Settings > Network Settings
- Select "Manual proxy configuration"
- Enter HTTP Proxy: 127.0.0.1
- Enter Port: 8080
- Click OK
For Chrome:
- Go to Settings > Advanced > System
- Click "Open your computer's proxy settings"
- Enter HTTP Proxy: 127.0.0.1
- Enter Port: 8080
- Click Save
-
Navigate to the windows directory:
cd windows -
You can either:
- Use the pre-compiled
proxy.exedirectly - Or compile from source using MinGW-w64:
gcc -o proxy.exe WinProxy.c -lssl -lcrypto
- Use the pre-compiled
-
Run the proxy server:
proxy.exe
The server will start on port 8080 by default. Configure your browser's proxy settings as mentioned above.
- HTTP/HTTPS proxy support
- SSL/TLS encryption
- Request logging
- Configurable port settings
- Cross-platform compatibility
- Error handling and recovery
Both Linux and Windows versions maintain logs in their respective proxy_log.txt files. The logs include:
- Connection attempts
- Request details
- Error messages
- SSL/TLS handshake information
- The included SSL certificates are for development purposes only
- For production use, replace
server.crtandserver.keywith your own certificates - Always use HTTPS for sensitive data transmission
-
If the server fails to start:
- Check if port 8080 is already in use
- Verify SSL certificate permissions
- Ensure all required libraries are installed
-
If connections fail:
- Verify proxy settings in your browser
- Check firewall settings
- Review the log file for error messages
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.