mirror of
https://github.com/openziti/zrok.git
synced 2024-11-25 01:23:49 +01:00
adjust sdk examples to use backend instead of
This commit is contained in:
parent
240fadfa4b
commit
c4842a5a81
@ -20,7 +20,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
shr, err := sdk.CreateShare(root, &sdk.ShareRequest{
|
shr, err := sdk.CreateShare(root, &sdk.ShareRequest{
|
||||||
BackendMode: sdk.TcpTunnelBackendMode,
|
BackendMode: sdk.ProxyBackendMode,
|
||||||
ShareMode: sdk.PublicShareMode,
|
ShareMode: sdk.PublicShareMode,
|
||||||
Frontends: []string{"public"},
|
Frontends: []string{"public"},
|
||||||
Target: "http-server",
|
Target: "http-server",
|
||||||
|
@ -21,7 +21,7 @@ program
|
|||||||
|
|
||||||
// Create the zrok private share that will represent this web server
|
// Create the zrok private share that will represent this web server
|
||||||
console.log("Now creating your private zrok share...")
|
console.log("Now creating your private zrok share...")
|
||||||
let shr = await zrok.CreateShare(root, new zrok.ShareRequest(zrok.TCP_TUNNEL_BACKEND_MODE, zrok.PRIVATE_SHARE_MODE, "http-server", ["private"]));
|
let shr = await zrok.CreateShare(root, new zrok.ShareRequest(zrok.PROXY_BACKEND_MODE, zrok.PRIVATE_SHARE_MODE, "http-server", ["private"]));
|
||||||
console.log(`access your private HTTP Server on another machine using: 'zrok access private ${shr.Token}'`)
|
console.log(`access your private HTTP Server on another machine using: 'zrok access private ${shr.Token}'`)
|
||||||
|
|
||||||
// Create a NodeJS Express web server that listens NOT on a TCP port, but for incoming Ziti connections to the private zrok share
|
// Create a NodeJS Express web server that listens NOT on a TCP port, but for incoming Ziti connections to the private zrok share
|
||||||
|
@ -27,7 +27,7 @@ if __name__ == '__main__':
|
|||||||
root = zrok.environment.root.Load()
|
root = zrok.environment.root.Load()
|
||||||
try:
|
try:
|
||||||
shr = zrok.share.CreateShare(root=root, request=ShareRequest(
|
shr = zrok.share.CreateShare(root=root, request=ShareRequest(
|
||||||
BackendMode=zrok.model.TCP_TUNNEL_BACKEND_MODE,
|
BackendMode=zrok.model.PROXY_BACKEND_MODE,
|
||||||
ShareMode=zrok.model.PUBLIC_SHARE_MODE,
|
ShareMode=zrok.model.PUBLIC_SHARE_MODE,
|
||||||
Frontends=['public'],
|
Frontends=['public'],
|
||||||
Target="http-server"
|
Target="http-server"
|
||||||
|
Loading…
Reference in New Issue
Block a user