Installing ngrok on OSX
下载也不好下载,用迅雷都下载下来,然后直接使用终端命令倒是下载下来了。
迅雷都下不了的东西用终端倒是下完了。。。
curl -o ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-amd64.zip
本来安装官网的操作,下载文件并解压文件,然后运行文件,发现找不命令。
然后就在网上搜到了这个
非常感谢wosephjeber提供了解决方案。
下载完成后,将解压过后的那个文件 ngork 扔到应用里
然后创建软连接。创建软连接的步骤就是
- cd 到 bin 目录下
cd /usr/local/bin
- 创建软连接:
ln -s /Applications/ngrok ngrok
软连接创建完成就可以使用了。下面是从wosephjeber哪里复制过来的内容。
- Download ngrok
- Unzip it to your Applications directory
- Create a symlink (instructions below)
Creating a symlink to ngrok
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory
cd /usr/local/bin
# create symlink
ln -s /Applications/ngrok ngrok
This will allow you to run the ngrok
command from any directory while in the terminal. Without the symlink, you would need to either cd
into the Applications directory (or wherever you installed the executable) or reference ngrok with its full path every time (e.g. /Applications/ngrok 5000
)
Using ngrok
The easiest way to use ngrok to tunnel into your localhost is if your local project is running on a specific port (e.g. not using named vhosts). You just run ngrok http [port number]
.