fnOS Cloudflare Tunnel SDK for Python
Project description
fnos-tunnel (Python)
fnOS Cloudflare Tunnel SDK for Python — 将 Tunnel 管理能力集成到你的 Python 应用中。
安装
pip install fnos-tunnel
或从源码安装:
pip install git+https://github.com/dustink66/fnos-tunnel-sdk-python.git
快速开始
from fnos_tunnel import TunnelAPIClient
client = TunnelAPIClient(
"http://<your-fnos-ip>:19092",
app_id="<your_app_id>",
app_key="<your_app_key>",
app_name="com.example.myapp",
)
# 健康检查
print(client.health()) # True
# 查询 Tunnel 状态
status = client.status()
print(f"Running: {status.running}, PID: {status.pid}")
# 查询域名状态
ds = client.domain_status()
print(f"Registered: {ds.registered}")
# 注册域名
result = client.register("myapp.example.com", "http://localhost:8080")
print(f"Success: {result.success}")
API
| 方法 | 说明 |
|---|---|
health() |
健康检查,无需认证 |
status() |
查询 Tunnel 运行状态 |
domain_status(app_name?) |
查询域名注册状态 |
register(domain, service, app_name?) |
注册/更新域名转发规则 |
发布到 PyPI
pip install build twine
python -m build
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fnos_tunnel-1.0.1.tar.gz
(5.5 kB
view details)
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 fnos_tunnel-1.0.1.tar.gz.
File metadata
- Download URL: fnos_tunnel-1.0.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc946c6091a2fb16fa2fdf86ff08c9d6e564abbb107b153ac76ba2147dbb5fb9
|
|
| MD5 |
c747b6c9df93b27293f872dd56583711
|
|
| BLAKE2b-256 |
8069f1e5364b5a512c138197e6d164fcb53f0a3b88e111d4c2dec0162c59aca7
|
File details
Details for the file fnos_tunnel-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fnos_tunnel-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40697971bb5c72dbeb615f1b9670ccc9410de466ce9c4c87a7064bdac6c9426
|
|
| MD5 |
8e88e13867a9ecb26b6078b4e0645398
|
|
| BLAKE2b-256 |
40f842c357ea8f0d627a69b1db6337e8db823d7d043707818a5cc503ce030790
|