mirror of
https://github.com/openziti/zrok.git
synced 2025-08-09 08:05:04 +02:00
add share mode
This commit is contained in:
@ -31,23 +31,30 @@ def main():
|
||||
parser.add_argument('-f', '--frontends', nargs='+', help='One or more space-separated frontends to use')
|
||||
parser.add_argument('-k', '--insecure', action='store_false', dest='verify_ssl', default=True,
|
||||
help='Skip SSL verification')
|
||||
parser.add_argument('-s', '--share-mode', default='public', choices=['public', 'private'],
|
||||
help='Share mode (default: public)')
|
||||
args = parser.parse_args()
|
||||
|
||||
logger.info("=== Starting proxy server ===")
|
||||
logger.info(f"Target URL: {args.target_url}")
|
||||
logger.info(f"Share mode: {args.share_mode}")
|
||||
|
||||
# Load environment and create proxy share
|
||||
root = zrok.environment.root.Load()
|
||||
proxy_share = ProxyShare.create(
|
||||
root=root,
|
||||
target=args.target_url,
|
||||
share_mode=args.share_mode,
|
||||
unique_name=args.unique_name,
|
||||
frontends=args.frontends,
|
||||
verify_ssl=args.verify_ssl
|
||||
)
|
||||
|
||||
# Log access information and start the proxy
|
||||
logger.info(f"Access proxy at: {', '.join(proxy_share.endpoints)}")
|
||||
if args.share_mode == "public":
|
||||
logger.info(f"Access proxy at: {', '.join(proxy_share.endpoints)}")
|
||||
elif args.share_mode == "private":
|
||||
logger.info(f"Run a private access frontend: 'zrok access private {proxy_share.token}'")
|
||||
proxy_share.run()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user