Metadata-Version: 2.4
Name: publichost
Version: 0.1.6
Summary: Make localhost public in one line
Project-URL: Homepage, https://publichost.dev
Project-URL: Documentation, https://pypi.org/project/publichost
Author-email: Spencer Kinney <email@spencerkinney.dev>
License: # LICENSE
        MIT License
        
        Copyright (c) 2024 PublicHost
        
        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.
License-File: LICENSE
Keywords: development,localhost,networking,tunnel
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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
Requires-Python: >=3.8
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: websockets>=10.0
Description-Content-Type: text/markdown

# publichost
**Make localhost public**  

Share your local web apps instantly with a public URL.  

🔗 **Visit [publichost.dev](https://publichost.dev)**

---

## 🚀 Installation
```sh
pip install publichost
```

---

## 🏁 Quick Start

Expose **any web server** in **one line**.

```python
from publichost import Tunnel
tunnel = Tunnel(port=3000)  # Expose local port 3000

print(f"🔗 {tunnel.public_url}")  # Get your public link
```

**Example Output:**
```
🔗 https://x8k2p.publichost.dev
```
Your local app is now **online and shareable**.

---

## 🌍 Works with Any Python Web Framework

### Flask
```python
from flask import Flask
from publichost import Tunnel

app = Flask(__name__)
tunnel = Tunnel(port=5000)

@app.route("/")
def home():
    return "Hello, publichost!"

if __name__ == "__main__":
    print(f"🔗 {tunnel.public_url}")
    app.run(port=5000)
```

### FastAPI
```python
from fastapi import FastAPI
from publichost import Tunnel
import uvicorn

app = FastAPI()
tunnel = Tunnel(port=8000)

@app.get("/")
async def read_root():
    return {"message": "Hello, publichost!"}

if __name__ == "__main__":
    print(f"🔗 {tunnel.public_url}")
    uvicorn.run(app, host="127.0.0.1", port=8000)
```

**Works with any Python web server**, including **Django, Quart, Starlette, and more**.

---

## 🔧 Custom Subdomains
By default, publichost assigns a **random subdomain** like `x8k2x.publichost.dev`.  
To set a **custom subdomain**, pass it as an argument:

```python
tunnel = Tunnel(port=5000, subdomain="mycustomapp")
```
Your app will be available at **`https://mycustomapp.publichost.dev`**.

**Subdomain Rules:**
- Must be **6-32 characters**
- Can contain **letters, numbers, and hyphens**
- Cannot be a **reserved system word** (e.g., `admin`, `www`, `api`)

---

## 📚 How It Works
1. Install `publichost`
2. Add **one line of code**
3. Get a **public URL** instantly

For more details, visit **[publichost.dev](https://publichost.dev)**.
