LoginSignup
0
1

More than 3 years have passed since last update.

【Mac】ローカルホストに、一時的に外部からアクセス出来るようにする

Last updated at Posted at 2020-08-06

ngrokアカウント作成

Setup&Installation

ngrokをダウンロード

スクリーンショット 2020-08-07 3.10.03.png

1. Unzip to install

ダブルクリックで解凍してから、二本指クリック(control+クリック)から「開く」を選択
or

Macターミナル
unzip /path/to/ngrok.zip

2. Connect your account

アカウントに接続

Macターミナル
./ngrok authtoken {Your Authtoken}

AuthenticationタブのYour Authtokenでも確認出来る

3. Fire it up

ローカルに外部から接続出来るhttpとhttpsのURLを発行

Macターミナル
# Dockerとかで80番ポートを使用している場合(http://localhostに繋ぎたい場合)
./ngrok http 80

# MAMPで8888番ポートを使用してる場合(http://localhost:8888に繋ぎたい場合)
./ngrok http 8888
結果
Forwarding    http://xxxxxxxxxxxx.ngrok.io -> http://localhost:80                        
Forwarding    https://xxxxxxxxxxxx.ngrok.io -> http://localhost:80                   

http://xxxxxxxxxxxx.ngrok.io
or
https://xxxxxxxxxxxx.ngrok.io
にアクセスするとローカルホストに接続される

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1