Make localhost public in one line
Project description
publichost
Make localhost public
Share your local web apps instantly with a public URL.
🔗 Visit publichost.dev
🚀 Installation
pip install publichost
🏁 Quick Start
Expose any web server in one line.
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
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
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:
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
- Install
publichost - Add one line of code
- Get a public URL instantly
For more details, visit publichost.dev.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file publichost-0.1.6.tar.gz.
File metadata
- Download URL: publichost-0.1.6.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
832708c02381d3fa481135ec9ca51f1b7659b226b7ed4ed4b4f0601868f98b63
|
|
| MD5 |
d86af6eafc9d0652142f46286cf6b781
|
|
| BLAKE2b-256 |
dbc28287671b302c26da531d6b15dedb7c346012ee3bb5495667cf6e8944c075
|
File details
Details for the file publichost-0.1.6-py3-none-any.whl.
File metadata
- Download URL: publichost-0.1.6-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7cc0dfd88813051a477f33ce21f3d47b3eed924fa0d717d277df79dbde6587a
|
|
| MD5 |
39f0c2b56d36d8a58c0e81c9a8df1a20
|
|
| BLAKE2b-256 |
c303934253710dce8d83e5fb6f3bef24ce23a1cc8df2826d3889664058414b00
|