Metadata-Version: 2.2
Name: mooo
Version: 0.1.1
Summary: A simple http proxy
Author-email: Hang <bebound@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Hang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/bebound/mooo
Project-URL: Source, https://github.com/bebound/mooo/
Keywords: HTTP,proxy
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.5
Provides-Extra: test
Requires-Dist: requests; extra == "test"
Requires-Dist: pytest; extra == "test"

Mooo
---------

[![PyPI version](https://badge.fury.io/py/mooo.svg)](https://badge.fury.io/py/mooo)

Mooo is a lightweight HTTP proxy written in Python. You can run it in a server then use it to access the internet.

## Quick Start

> [!WARNING]
> By default, mooo porxy all domains, which means it can retrieve the local network. This poses a security risk.
> It is recommended to specify `--domain` or `--profile` to limit the domain that the proxy server

### Option 1: Use Python package

1. Install moon with `pip install mooo`

2. Start the proxy server

```bash
mooo --host 0.0.0.0 --port 8080
```


### Option 2: Use Docker image

```bash
docker run -p 8080:8080 bebound/mooo --host 0.0.0.0 --port 8080
```

### Use mooo

```bash
curl http://your_proxy_server:8080/{http_url}
git clone http://your_proxy_server:8080/{github_url}
```

#### Use pre-defined profile

Mooo provides some pre-defined profiles, you can use it to proxy some popular websites. Currently, it supports `github`, `google` and `docker`.

Use mooo to proxy github.com
```bash
mooo --profile github --profile github
```

Use mooo to proxy multiple profile with same port. You need to use reverse proxy to route the request to mooo with specific domain. Mooo routes the request to different profile based on the domain. For example, access `github.custom.domain` will route to github.com and `docker.custom.domain` will route to docker registry.
```bash
mooo --profile github docker google --smart-route
```

## Parameters

| Parameter          | Description                                                           | Default   | Example                  |
|--------------------|-----------------------------------------------------------------------|-----------|--------------------------|
| `--host`           | The listening host                                                    | 127.0.0.1 | 0.0.0.0                  |
| `--port`           | The listening port                                                    | 8080      |                          |
| `--debug`          | Show debug logging                                                    | False     |                          |
| `--domain`         | Once it's set, the request domain must match the wildcard domain list | None      | `*.github.com`           | 
| `--cookie`         | Pass the cookie to the server                                         | False     |                          |
| `--default-domain` | The default domain to proxy                                           | None      | `https://www.github.com` |
| `--profile`        | Use pre-defined profile                                               | None      | `github`                 |
| `--smart-route`    | Apply profile rules based on host domain                              | False     |                          | 
