mirror of
https://github.com/openziti/zrok.git
synced 2025-02-08 14:29:52 +01:00
commit
030c87aa4b
@ -24,14 +24,13 @@ Expected output:
|
|||||||
from zrok.proxy import ProxyShare
|
from zrok.proxy import ProxyShare
|
||||||
import zrok
|
import zrok
|
||||||
|
|
||||||
# Load the environment
|
# Load the user's zrok environment from ~/.zrok
|
||||||
root = zrok.environment.root.Load()
|
zrok_env = zrok.environment.root.Load()
|
||||||
|
|
||||||
# Create a temporary proxy share (will be cleaned up on exit)
|
# Create a temporary proxy share (will be cleaned up on exit)
|
||||||
proxy = ProxyShare.create(root=root, target="http://my-target-service")
|
proxy = ProxyShare.create(root=zrok_env, target="http://127.0.0.1:3000")
|
||||||
|
|
||||||
# Access the proxy's endpoints and token
|
print(f"Public URL: {proxy.endpoints}")
|
||||||
print(f"Access proxy at: {proxy.endpoints}")
|
|
||||||
proxy.run()
|
proxy.run()
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -43,6 +42,6 @@ To create a share token that persists and can be reused, run the example `proxy.
|
|||||||
proxy = ProxyShare.create(
|
proxy = ProxyShare.create(
|
||||||
root=root,
|
root=root,
|
||||||
target="http://127.0.0.1:3000",
|
target="http://127.0.0.1:3000",
|
||||||
unique_name="my-persistent-proxy"
|
unique_name="myuniquename"
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user