ngrok配置信息_ngrok客户端参数使用说明

本文详细介绍了ngrok客户端的配置和使用方法,包括如何设置自定义子域名、HTTP基本认证、TCP隧道以及日志选项。通过示例展示了启动不同类型的隧道,如HTTP、HTTPS和TCP,并提供了高级用法,如指定配置文件、启动所有隧道和控制日志输出。
摘要由CSDN通过智能技术生成

ngrok客户端配置说明.

官方帮助[root@localhost ngrok]# ./ngrok --help

Usage: ./ngrok [OPTIONS]

Options:

-authtoken string

Authentication token for identifying an ngrok.com account

-config string

Path to ngrok configuration file. (default: $HOME/.ngrok)

-hostname string

Request a custom hostname from the ngrok server. (HTTP only) (requires CNAME of your DNS)

-httpauth string

username:password HTTP basic auth creds protecting the public tunnel endpoint

-log string

Write log messages to this file. 'stdout' and 'none' have special meanings (default "none")

-log-level string

The level of messages to log. One of: DEBUG, INFO, WARNING, ERROR (default "DEBUG")

-proto string

The protocol of the traffic over the tunnel {'http', 'https', 'tcp'} (default: 'http+https') (default "http+https")

-subdomain string

Request a custom subdomain from the ngrok server. (HTTP only)

Examples:

ngrok 80

ngrok -subdomain=example 8080

ngrok -proto=tcp 22

ngrok -hostname="example.com" -httpauth="user:password" 10.0.0.1

Advanced usage: ngrok [OPTIONS] [command args] [...]

Commands:

ngrok start [tunnel] [...] Start tunnels by name from config file

ngork start-all Start all tunnels defined in config file

ngrok list List tunnel names from config file

ngrok help Print help

ngrok version Print ngrok version

Examples:

ngrok start www api blog pubsub

ngrok -log=stdout -config=ngrok.yml start ssh

ngrok start-all

ngrok version

实例server_addr: ngrok.zuobin.net:4443

trust_host_root_certs: false

tunnels:

#带auth

authweb:

auth: "user:psw123"

proto:

http: 8080

#普通穿透

web:

proto:

http: 8080

#带auth转发到别的IP和端口

webforward:

auth: "user:psw123"

proto:

http: 192.168.2.201:8080

#tcp转发到ssh端口

ssh:

proto:

tcp: 22

#转发tcp

sshforward:

proto:

tcp: 192.168.2.202:22

#cname到别的域名

webcname:

proto: http

auth: "user:psw123"

addr: 80

hostname: demo.example.com

开启所有转发

ngrok -config=ngrok.cfg start-all

开启指定配置

ngrok -config=ngrok.cfg start authweb

指定不需要日志

ngrok -log=none -config=ngrok.cfg start web

指定日志路径和level

ngrok -log=/var/log/ngrok/ngrok.log -log-level=INFO -config=ngrok.cfg start web

原文链接:ngrok客户端参数使用说明,转载请注明来源!

分享到:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值