# Cloudflared Context Manager
Simple context manager to create a Cloudflared tunnel for a localhost port of choice.
Minimal example on how to use this package with Gradio:
```python
import gradio as gr
import cloudflared_tunnel
with gr.Blocks() as demo:
with gr.Column():
with gr.Row():
input_text = gr.Textbox(lines=10, label="Input")
output_text = gr.Textbox(lines=10, label="Output")
submit_button = gr.Button(value="Echo")
submit_button.click(lambda x: x, inputs=input_text, outputs=output_text)
if __name__ == "__main__":
with cloudflared_tunnel.run() as port:
demo.launch(show_api=False, server_port=port)
```
## Acknowledgements
This project is derived from [flask-cloudflared](https://github.com/UWUplus/flask-cloudflared), which in turn is based on [flask-ngrok](https://github.com/gstaff/flask-ngrok).
Raw data
{
"_id": null,
"home_page": "https://github.com/UWUplus/soldni/python-cloudflare-tunnel",
"name": "cloudflared-tunnel",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "cloudflare tunnel python",
"author": "Ralf Rademacher and Luca Soldaini",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/bd/27/75908adbf1d828923af1f05eb357fe5380a9a827398a4866e4d54faacbbc/cloudflared_tunnel-0.1.0.tar.gz",
"platform": null,
"description": "# Cloudflared Context Manager\n\nSimple context manager to create a Cloudflared tunnel for a localhost port of choice.\n\nMinimal example on how to use this package with Gradio:\n\n```python\nimport gradio as gr\nimport cloudflared_tunnel\n\nwith gr.Blocks() as demo:\n with gr.Column():\n with gr.Row():\n input_text = gr.Textbox(lines=10, label=\"Input\")\n output_text = gr.Textbox(lines=10, label=\"Output\")\n submit_button = gr.Button(value=\"Echo\")\n submit_button.click(lambda x: x, inputs=input_text, outputs=output_text)\n\nif __name__ == \"__main__\":\n with cloudflared_tunnel.run() as port:\n demo.launch(show_api=False, server_port=port)\n```\n\n## Acknowledgements\n\nThis project is derived from [flask-cloudflared](https://github.com/UWUplus/flask-cloudflared), which in turn is based on [flask-ngrok](https://github.com/gstaff/flask-ngrok).\n",
"bugtrack_url": null,
"license": null,
"summary": "Start a TryCloudflare Tunnel with a context manager.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/UWUplus/soldni/python-cloudflare-tunnel"
},
"split_keywords": [
"cloudflare",
"tunnel",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ef7d898bcc65b4c2ca3fb1c1c1d365a75e838c99fa14990884de3db3d135434a",
"md5": "0d76385f0cf17fedcbf11efff9b8d3c3",
"sha256": "9911f2163b464b1db8610b2baab24c30c45c31ff917a1e46068c3798f6403a8f"
},
"downloads": -1,
"filename": "cloudflared_tunnel-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0d76385f0cf17fedcbf11efff9b8d3c3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4180,
"upload_time": "2024-06-27T06:50:34",
"upload_time_iso_8601": "2024-06-27T06:50:34.586225Z",
"url": "https://files.pythonhosted.org/packages/ef/7d/898bcc65b4c2ca3fb1c1c1d365a75e838c99fa14990884de3db3d135434a/cloudflared_tunnel-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd2775908adbf1d828923af1f05eb357fe5380a9a827398a4866e4d54faacbbc",
"md5": "ebfc79768f3f461f755687306d732407",
"sha256": "07dd00bd8f87f09031e79855f552c530a66e625c27589eea00545dc24cd8ba79"
},
"downloads": -1,
"filename": "cloudflared_tunnel-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "ebfc79768f3f461f755687306d732407",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3779,
"upload_time": "2024-06-27T06:50:36",
"upload_time_iso_8601": "2024-06-27T06:50:36.691613Z",
"url": "https://files.pythonhosted.org/packages/bd/27/75908adbf1d828923af1f05eb357fe5380a9a827398a4866e4d54faacbbc/cloudflared_tunnel-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-27 06:50:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "UWUplus",
"github_project": "soldni",
"github_not_found": true,
"lcname": "cloudflared-tunnel"
}