Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudfare tunneling for permament link #11

Open
natolambert opened this issue Jun 27, 2024 · 0 comments
Open

Cloudfare tunneling for permament link #11

natolambert opened this issue Jun 27, 2024 · 0 comments
Assignees

Comments

@natolambert
Copy link
Collaborator

another utility for demos: just pushed cloudflared-tunnel to pypi. Works similarly to public gradio links, but uses cloudflare and links never expire. To use:

#! pip install cloudflared-tunnel

import gradio as gr
import cloudflared_tunnel

with gr.Blocks() as demo:
    # setup your demo here
    ...

with cloudflared_tunnel.run() as port:
    demo.launch(show_api=False, server_port=port)

It will spit out something like the following:

 * Running on https://considering-fame-from-household.trycloudflare.com/
 * Traffic stats available on http://127.0.0.1:9835/metrics
Running on local URL:  http://127.0.0.1:8972/

To create a public link, set `share=True` in `launch()`.

Then you can use the url .trycloudflare.com to connect to your demo 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants