This project is tested with BrowserStack.
xray
This project is tested with BrowserStack
X-Ray Proxy
X-Ray Proxy is a lightweight, multi-threaded HTTP/HTTPS proxy server implemented in Python. This project serves as a basic example of how to create a transparent proxy that can handle both HTTP and HTTPS traffic.
Features
- Supports both HTTP and HTTPS connections
- Multi-threaded design for handling multiple connections simultaneously
- Parses incoming requests to determine target host and port
- Establishes connections to target servers on behalf of clients
- Facilitates bidirectional communication between clients and servers
How It Works
- The proxy listens for incoming connections on a specified host and port.
- For each new connection, a separate thread is spawned to handle the client.
- The client's request is parsed to determine the target server and port.
- A connection is established with the target server.
- Two additional threads are created to handle bidirectional data flow between the client and the server.
- For HTTPS connections, the socket is wrapped with SSL.
Usage
- Run the script on your local machine:
-
- Configure your browser or application to use
127.0.0.1:8080
as the proxy server.
Limitations and Disclaimer
This is a basic implementation intended for educational purposes. It lacks many features of a production-ready proxy, such as:
- Robust error handling
- Logging
- Security measures (e.g., authentication, encryption)
- Performance optimizations
Do not use this in a production environment without significant improvements.
Contributing
Contributions to improve the proxy or add features are welcome. Please feel free to submit a pull request or open an issue to discuss potential changes/additions.
License
MIT License
This project is tested with BrowserStack
Acknowledgements
This project was created as a learning exercise in network programming and proxy server implementation.
This project is tested with BrowserStack.