Added cloudflared features - #4
TejasPersonal wants to merge 1 commit into
Conversation
|
Thank you for your contribution. |
| cloudflared_path = shutil.which("cloudflared") | ||
|
|
||
| if cloudflared_path is not None: | ||
| self.executable = cloudflared_path | ||
| return |
There was a problem hiding this comment.
Other programs I've seen that use already installed applications usually receive them via environment variables. That approach seems like the way to go here as well.
There was a problem hiding this comment.
well ...
after evaluating pycloudflared, I found it doesn't meet my requirements. The library is missing features and lacks robustness
therefore: https://github.com/TejasPersonal/flared [I didn't write much readme yet]
this doesn't work like a auto download wrapper, its more of a interface or client
I learnt about atexit from your code, thanks!
What's New
System
cloudflaredBinary DetectionIf
cloudflaredis already installed on the system (found viaPATH), it will be used directly instead of downloading a bundled copy.Why:
hostandschemeArguments (tunnelfunction)The tunnel-launching function — previously exposed as
__call__— has been renamed totunnel()and now accepts two new arguments:hostandscheme.Why:
hostallows forwarding a custom local IP address instead of assuming127.0.0.1.scheme(protocol) allows forwarding non-HTTP traffic — most notablytcp, which makes it possible to tunnel arbitrary TCP services such as SSH.accessFunctionA new
access()function usescloudflaredto proxy a remote tunnel URL back down to a local address.Why: this complements
tunnel()to enable full round-trip forwarding. For example,tunnel()can expose a local SSH port as a public HTTPS tunnel URL;access()can then be used on another device to consume that URL and proxy it back into a local TCP connection.ssh/tcp (host) → https (forwarded tunnel URL) → ssh/tcp (proxied local access)
This effectively lets you SSH into a machine through a Cloudflare tunnel, without exposing the SSH port directly to the internet.