ã¯ããã«
çãããããã«ã¡ã¯ãMisocaãã¼ã from ãã¡ã³ãã ã¿ã¤ãã®ããã¼ ( twitter:@yusuke_kokubo ) ã§ãã çé ¸æ°´ã箱買ãããééã£ã¦èªå® ã«çºéãã¦ãã¾ã£ã¦ããããªãã®ã§éº¦è¶ã飲ãã§ããæè¿ã§ãã ãã¦ãæ¬é¡ã«å ¥ãåã«ã¾ãçããã«ãè©«ã³ãç³ãä¸ããªããã°ããã¾ããã
前回記事ã®æå¾ã«ã次åãã©ã°ãã¼é¨ã®å¤§å¦çã¨ã¹ã¯ã©ã ãã¦ã¿ã(ä»®)ãã§ãä¼ããã¾ãããããã¨æ¸ããã«ãããããããä»åãçé¢ç®ãªè¨äºã«ãªã£ã¦ãã¾ãã¾ããã 謹ãã§ãè©«ã³ç³ãä¸ãã¾ãã次åããæ£çæ£éã®ãã¿è¨äºãæ¸ãã¾ãã®ã§ã©ããããå°ã ãå¾ ã¡ããã ããã°ã¨æãã¾ãã
é話ä¼é¡
ã¢ããªã±ã¼ã·ã§ã³ãéçºãã¦ããã¨ç¤¾å¤ã®ãããã¯ã¼ã¯ããéçºç°å¢ã¸æ¥ç¶ããããªãã¾ãããï¼ ä¾ãã°å¤é¨ã®ãµã¼ãã¹ã¨é£æºããããã¨ãã¨ããã¹ããããè¦ããã¨ãã¨ããã¨ãã¨ãã ãããªã¨ãã¯ngrokã使ã£ã¦ãã¼ããã©ã¯ã¼ãã£ã³ã°ããã®ã便å©ã§ãã
æåã«è«¸æ³¨æï¼
ãã¼ããã©ã¯ã¼ãã£ã³ã°ã¯ãããã¯ã¼ã¯ã«ç©´ãéããè¡çºã§ãã ã»ãã¥ãªãã£ä¸ã®ãªã¹ã¯ãæ¿ç¥ããããã§ä½¿ãããã«ãã¾ãããã *2
ngrokã£ã¦ï¼ (ãã¼ããã©ã¯ã¼ãã£ã³ã°ã¨ã¯)
ç»åã¯ngrok.comããå¼ç¨
- ãã¼ã«ã«ã®ãããã¯ã¼ã¯ã¨ngrok.comã®éã«ãããã¯ã¼ã¯ä¸ã®ãã³ãã«ãæã(ãã¼ããéæ¾ãã)
- ã°ãã¼ãã«ãªãããã¯ã¼ã¯ããngrok.comã«ã¢ã¯ã»ã¹ããã¨ããã¼ã«ã«ãªãããã¯ã¼ã¯ã¸ãã±ããã転éããã
- ãã®çµæããã¼ã«ã«ã®PCã«å¤é¨ããã¢ã¯ã»ã¹ã§ããããã«ãªã
ã¡ãã£ã¨ãããã§ããããªã®ã§å¿ è¦ãªã¨ãã«å¿ è¦ãªåã ãããªã¹ã¯ãèãã¦ä½¿ãã¾ãããã
ã¾ãã¯ãã¦ã³ãã¼ã
ç°å¢ã«ãã£ããã¡ã¤ã«ããã¦ã³ãã¼ããã¾ãããã (ããã§ã¯Macç¨ããã¦ã³ãã¼ãããã¨ãã¾ã)
ãã¦ã³ãã¼ãããzipãã¡ã¤ã«ã解åããã¨å®è¡ãã¡ã¤ã«ãã§ããã®ã§é©å½ãªãã£ã¬ã¯ããªã«é ç½®ãã¾ãã
åããã¦ã¿ã
æ©éåããã¦ã¿ã¾ãã
$ ./ngrok http 80
ããã§ãã¼ã«ã«ã®80çªãã¼ããå¤é¨ã«åãã¦éæ¾ãããã¨ã«ãªãã¾ããã
Tunnel Status online Version 2.0.19/2.0.19 Web Interface http://127.0.0.1:4040 Forwarding http://1ccaa7cb.ngrok.io -> localhost:80 Forwarding https://1ccaa7cb.ngrok.io -> localhost:80 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
ããã§ã¤ã³ã¿ã¼ãããã«ã¤ãªãã端æ«ãªãã©ãããã§ã http://1ccaa7cb.ngrok.io
ã«ã¢ã¯ã»ã¹ããã°ãã¼ã«ã«ã®80çªã«ã¤ãªããã¾ãããæ軽ã§ããã
ãµããã¡ã¤ã³ã® 1ccaa7cb
ã¯åãããã³ã«ã©ã³ãã ãªæååãè¨å®ããã¾ãã
ãµããã¡ã¤ã³ãåºå®ã«ãã¦ä½¿ããã
ãµããã¡ã¤ã³ã«ã¯ããã©ã«ãã§ã¯ã©ã³ãã ãªæååãè¨å®ããã¾ãããèªåã§æå®ãããã¨ãã§ãã¾ãã ãã®ããã«ã¯ngrok.comã«ãµã¤ã³ã¢ãããã¾ãããã ( freeãã©ã³ã§ç»é²ããå ´åã¯ngrokã¸ã®æè¬ãã¤ã¶ãããªããã¦ãã ããã )
ãµã¤ã³ã¢ããããã¨ãã¼ã¯ã³ãçºè¡ãããã®ã§ãç»é¢ã«æ示ãããã¨ããã«ã³ãã³ããå®è¡ãã¾ãã
$ ./ngrok authtoken [token] Authtoken saved to configuration file: /Users/[User]/.ngrok2/ngrok.yml
ããã§ä½¿ããããã«ãªãã¾ããã
試ãã¦ã¿ã¾ãããã
$ ./ngrok http 80 --subdomain=praisev8
Tunnel Status online Version 2.0.19/2.0.19 Web Interface http://127.0.0.1:4040 Forwarding http://praisev8.ngrok.io -> localhost:80 Forwarding https://praisev8.ngrok.io -> localhost:80 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
ãã㧠http://praisev8.ngrok.io
ã«ã¦ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ããã *3
ã¾ã¨ã
ngrokã使ãã°é常ã«ãæ軽ã«ãã¼ããã©ã¯ã¼ãã£ã³ã°ãã§ããããã«ãªãã¾ãã æ©ä¼ãããã°ã試ããã ããã
次åäºå
ã¢ã¸ã£ã¤ã«ãªã¿ããªã大好ããªã¹ã¯ã©ã ããã£ã¦ã¿ãã®ã§ä»åº¦ããç´¹ä»ã§ããããããã¨æãã¾ãã
ããã§ã¯ãEnjoy ngrok !
*1:ã¨ãããæ¼ä¼ã¿ã®æ§åã§ã
*2:Misocaã§ã¯ã»ã³ã·ãã£ããªéç¨ãã¼ã¿ã¯éçºç°å¢ããåãé¢ãããã»ã°ã¡ã³ãã§ç®¡çããã¦ãã¾ãããã®ããä¸æçã¨ã¯ããéçºç°å¢ãå¤é¨ã«å ¬éãã¦ãåé¡ã¯ããã¾ãã
*3:å½ããåã®ãã¨ã§ãããä»ã®ã¦ã¼ã¶ã¼ã praisev8ã使ç¨ä¸ã®å ´åã¯ä½¿ãã¾ãã