mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Fast phone (#183)
This commit is contained in:
@@ -623,6 +623,7 @@ class Stream(WebRTCConnectionMixin):
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
import atexit
|
import atexit
|
||||||
|
import inspect
|
||||||
import secrets
|
import secrets
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
@@ -646,9 +647,18 @@ class Stream(WebRTCConnectionMixin):
|
|||||||
)
|
)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
url = setup_tunnel(
|
# Check if setup_tunnel accepts share_server_tls_certificate parameter
|
||||||
host, port, share_token=secrets.token_urlsafe(32), share_server_address=None
|
setup_tunnel_params = inspect.signature(setup_tunnel).parameters
|
||||||
)
|
tunnel_kwargs = {
|
||||||
|
"local_host": host,
|
||||||
|
"local_port": port,
|
||||||
|
"share_token": secrets.token_urlsafe(32),
|
||||||
|
"share_server_address": None,
|
||||||
|
}
|
||||||
|
if "share_server_tls_certificate" in setup_tunnel_params:
|
||||||
|
tunnel_kwargs["share_server_tls_certificate"] = None
|
||||||
|
|
||||||
|
url = setup_tunnel(**tunnel_kwargs)
|
||||||
host = urllib.parse.urlparse(url).netloc
|
host = urllib.parse.urlparse(url).netloc
|
||||||
|
|
||||||
URL = "https://api.fastrtc.org"
|
URL = "https://api.fastrtc.org"
|
||||||
|
|||||||
Reference in New Issue
Block a user