https://github.com/derder3010/proxy
Flask Proxy IP Web Service
https://github.com/derder3010/proxy
flask proxy-scraper python
Last synced: about 1 month ago
JSON representation
Flask Proxy IP Web Service
- Host: GitHub
- URL: https://github.com/derder3010/proxy
- Owner: derder3010
- Created: 2024-07-10T01:16:28.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-12T16:09:04.000Z (10 months ago)
- Last Synced: 2025-01-28T12:45:52.072Z (3 months ago)
- Topics: flask, proxy-scraper, python
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flask Proxy IP Web Service
This project is a Flask-based web service that acts as a proxy for HTTP requests. It forwards requests to a target URL specified in the `X-Target-URL` header and returns the response back to the client. This can be useful for changing proxies when making requests with Python.
## Prerequisites
Ensure you have the following before setting up the project:
- Python 3.9+
- Docker (if you choose to run the application in a Docker container)## Installation
### Local Setup
1. **Clone the repository:**
```bash
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name
```2. **Create a virtual environment and activate it:**
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```3. **Install the required Python packages:**
```bash
pip install -r requirements.txt
```4. **Run the Flask application:**
```bash
python app.py
```### Docker Setup
1. **Build the Docker image:**
```bash
docker build -t flask-proxy-ip .
```2. **Run the Docker container:**
```bash
docker run -p 8080:8080 flask-proxy-ip
```The application should now be running and accessible at `http://localhost:8080`.
## Usage
To use the proxy service, make an HTTP request to the Flask server with the `X-Target-URL` header set to the URL you want to proxy.
### Example with `curl`
```bash
curl -X GET http://localhost:8080 -H "X-Target-URL: https://httpbin.org/get"
```Example with Python requests
```bash
import requestsresponse = requests.get(
'http://localhost:8080',
headers={'X-Target-URL': 'https://httpbin.org/get'}
)print(response.text)
```