{"id":4944,"date":"2018-05-06T23:57:51","date_gmt":"2018-05-06T23:57:51","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=4944"},"modified":"2018-06-11T07:58:18","modified_gmt":"2018-06-11T07:58:18","slug":"secure-tunnels-to-localhost-using-ngrok","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/secure-tunnels-to-localhost-using-ngrok\/","title":{"rendered":"Secure Tunnels to localhost using ngrok"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5004\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/architecture-after-ngrok-deployment.png\" alt=\"\" width=\"600\" height=\"350\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/05\/architecture-after-ngrok-deployment.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/05\/architecture-after-ngrok-deployment-300x175.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Secure Tunnels to localhost using ngrok<\/strong><\/p>\n<p><strong>ngrok is a free tool that allows you to expose a web server running on your local machine to the internet.<\/strong> It includes additional functionality that makes it easy to install and manage itself as a native operating system service on Windows, OS X and Linux.<\/p>\n<p>It is is a multiplatform tunnelling, reverse proxy software that establishes secure tunnels from a public endpoint such as internet to a locally running network service while capturing all traffic for detailed inspection and replay.<\/p>\n<p>The following are the issues that we were facing before Ngrok deployment:<\/p>\n<ol>\n<li>Unable to expose localhost application directly to internet without DMZ &amp; other network configuration<\/li>\n<li>Unable to demonstrate an application to Client on urgent basis<\/li>\n<li>Unable to share websites for testing purpose<\/li>\n<li>Develop any services which consume Webhooks (HTTP CallBacks)<\/li>\n<li>Can\u2019t share a website temporarily that is running only on our developer machine<\/li>\n<li>Time Consuming on network and DNS configurations<\/li>\n<li>Can\u2019t debug or inspect HTTP Traffic in a precise manner<\/li>\n<li>Can\u2019t run networked services on machines that are firewalled off from the internet<\/li>\n<li>Unable to expose application behind http proxy<\/li>\n<li>Unable to forward non-http and non-local network services<\/li>\n<\/ol>\n<p>It\u2019s really easy to install and use<\/p>\n<p>ngrok is built in Go so it is packaged as binaries for each major platform. To install ngrok do the following:<\/p>\n<ol>\n<li>Download the package for your system<\/li>\n<li>Unzip the package<\/li>\n<li>There is no step 3!<\/li>\n<\/ol>\n<p><strong>Once you have ngrok installed, using it to tunnel to an application running on, say, port 3000 is as easy as:<\/strong><\/p>\n<p>[code]$ .\/ngrok http 3000[\/code]<\/p>\n<p><strong>Once you\u2019ve unzipped the ngrok executable move it to a folder that\u2019s in your $PATH then you can run ngrok from anywhere you want on the command line by just typing:<\/strong><\/p>\n<p>[code]$ ngrok http 3000[\/code]<\/p>\n<p><strong>It has a dashboard<\/strong><br \/>\nhttp:\/\/127.0.0.1:4040<\/p>\n<p><strong>You can secure your tunnels<\/strong><\/p>\n<p>[code]$ ngrok http -auth &quot;user:password&quot; 3000[\/code]<\/p>\n<p><strong>You can use custom subdomains<\/strong><\/p>\n<p>[code]$ ngrok http -subdomain=thisisreallycool 3000[\/code]<\/p>\n<p><a href=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/Architecture-after-Ngrok-deployment.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4945\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/Architecture-after-Ngrok-deployment.jpg\" alt=\"\" width=\"849\" height=\"478\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/05\/Architecture-after-Ngrok-deployment.jpg 849w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/05\/Architecture-after-Ngrok-deployment-300x169.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/05\/Architecture-after-Ngrok-deployment-768x432.jpg 768w\" sizes=\"auto, (max-width: 849px) 100vw, 849px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Secure Tunnels to localhost using ngrok ngrok is a free tool that allows you to expose a web server running on your local machine to the internet. It includes additional functionality that makes it easy to install and manage itself as a native operating system service on Windows, OS X and Linux. It is is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[4921,4920],"class_list":["post-4944","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-localhost","tag-ngrok"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=4944"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4944\/revisions"}],"predecessor-version":[{"id":5007,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4944\/revisions\/5007"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5003"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=4944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=4944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=4944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}