はじめに
こんばんは。
ngrok今でもよく使っているんですが、あれは基本的に指定した一つのポートのみしか使えません。
ただ、設定ファイルを使って複数のポートを設定できるようです。
本題
よく使うのは以下だと思います。
$ ngrok http 8080 K8s Gateway API support available now: https://ngrok.com/r/k8sgb Session Status online Account xxxxxxxx (Plan: Free) Update update available (version 3.9.0, Ctrl-U to update) Version 3.8.0 Region Japan (jp) Web Interface http://127.0.0.1:4040 Forwarding https://93b2-240d-1a-936-9d00-706c-6bf9-72da-357f.ngrok-free.app -> http://localhost:8080 Connections ttl opn rt1 rt5 p50 p90
こんな感じで 8080番を使用できています。
今回は、設定ファイルを書いてみます。
$ cat local.yml version: 2 authtoken: xxxxxxxxxxxxxxxxxxxxxxxxxx_zzzzzzzzzzzzzzzzzzzzzzzzz tunnels: first: proto: http addr: 8080 second: proto: http addr: 8081
$ ngrok start --config local.yml --all Full request capture now available in your browser: https://ngrok.com/r/ti Session Status online Account xxxxxxxxxx (Plan: Free) Update update available (version 3.9.0, Ctrl-U to update) Version 3.8.0 Region Japan (jp) Web Interface http://127.0.0.1:4040 Forwarding https://0b88-240d-1a-936-9d00-706c-6bf9-72da-357f.ngrok-free.app -> http://localhost:8081 Forwarding https://563a-240d-1a-936-9d00-706c-6bf9-72da-357f.ngrok-free.app -> http://localhost:8080 Connections ttl opn rt1 rt5 p50 p90
Forwarding
を見てもらえたらわかりますが、設定ファイルに記載した2つのポートが使われています。
終わりに
ぶっちゃけ2つを使うことはそこまでなさそうですが、知っておくと便利そうです。
現場からは以上です。