NotePublic/Software/Applications/Ngrok/Ngrok_设置和使用.md

42 lines
678 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ngrok 设置和使用
Ngrok 可实现内网穿透。
官网和下载地址:<https://dashboard.ngrok.com>
配置文件参考 cpolar基本格式如下:
```bash
authtoken: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
log_level: info
log: /path/to/ngrok.log
update: false
update_channel: stable
tunnels:
tty:
proto: tcp
addr: 22
version: "2"
region: us
```
参考 Systemd 文件:
```bash
[Unit]
Description=Ngrok Service
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=rick
Group=rick
ExecStart=/<path>/<to>/ngrok --config /<path>/<to>/ngrok.yml start <channel name>
Restart=always
[Install]
WantedBy=multi-user.target
```