Metadata-Version: 2.4
Name: XcT_x_AyOuB
Version: 1.0.2
Summary: XcT x AyOuB - Auto-start Flask API service with dynamic port resolution for any hosting platform
Author: XcT x AyOuB
License: MIT
Keywords: flask,api,xct,ayoub,dynamic-port,hosting
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: flask>=2.0
Requires-Dist: requests
Requires-Dist: urllib3
Requires-Dist: pyjwt
Requires-Dist: pycryptodome
Requires-Dist: protobuf
Requires-Dist: protobuf-decoder
Requires-Dist: psutil

# XcT_x_AyOuB

Auto-start Flask API service with **dynamic port resolution**.

The server automatically picks the correct port based on the hosting environment
(Render, Railway, Heroku, Replit, Fly.io, Cloud Run, Azure, Koyeb, …) and falls
back to an OS-assigned free port when nothing is configured. **No more "port
already in use" or hard-coded 5000.**

## Install

```bash
pip install XcT_x_AyOuB
```

## Usage

```python
import XcT_x_AyOuB
```

That's it — the server starts and the process stays alive.
The banner shows you the actual port that was picked.

### Force a specific port

```bash
PORT=8080 python my_script.py
```

### Programmatic control

```python
import XcT_x_AyOuB
print("Server is on port", XcT_x_AyOuB.get_port())
```

### Endpoints

- `GET /start?uid=<UID>`
- `GET /stop?uid=<UID>`
- `GET /list`
- `GET /status`
- `GET /info?uid=<UID>`
- `GET /restart`
- `GET /settings` (GET/POST)

### Environment variables

The port resolver checks these env vars **in order** and uses the first one set:

`PORT`, `SERVER_PORT`, `HTTP_PORT`, `WEBSITES_PORT` (Azure), `FUNCTIONS_CUSTOMHANDLER_PORT`,
`REPL_PORT` (Replit), `NIXPACKS_PORT` (Railway), `APP_PORT` (Koyeb).

If none of them are set, the OS picks a free port automatically.

Other env vars:

- `XCT_NO_AUTOSTART=1` — disable auto-start, call `XcT_x_AyOuB.run()` manually
- `XCT_AUTOSTART_MODE=background` — run server in a daemon thread

## Changelog

### 1.0.2
- **Dynamic port resolution**: the server now adapts to the hosting platform
  instead of being hard-coded to 5000.
- Scans all common platform env vars (Render/Railway/Heroku/Replit/Azure/…).
- Falls back to an OS-assigned free port if none is configured.
- If the chosen port is already busy, a free one is picked automatically.
- New helpers: `XcT_x_AyOuB.get_port()` and `XcT_x_AyOuB.resolve_port()`.

### 1.0.1
- Default auto-start mode changed from `background` to `blocking`.
- Added startup banner with server URL.
