The HW Blog

Want to be updated? @opencoconut | Feed

Using LocalTunnel to receive the pings from Coconut in Local

Bruno Celeste (@brunoceleste)

April 01, 2014 Tech

Anyone developing against an external API that mostly relies on Ping (callback) mechanisms like Coconut has already encountered the issue of not being reachable from the Internet.

The only way to achieve that is to change your firewall configuration but that is not always possible / not convenient. It depends on many factors, for example, your network administrator.

Enter LocalTunnel, a service that is able to fix this common problem very easily! What is especially great about LocalTunnel is that you can install it on your own server.

Installing Localtunnel

To install LocaTtunnel, you must have NodeJS installed:

$ npm install -g localtunnel
npm http GET https://registry.npmjs.org/localtunnel
npm http GET https://registry.npmjs.org/localtunnel
npm http GET https://registry.npmjs.org/request/2.11.4
npm http GET https://registry.npmjs.org/book/1.2.0
npm http GET https://registry.npmjs.org/optimist/0.3.4
npm http GET https://registry.npmjs.org/http-raw/1.1.0
npm http GET https://registry.npmjs.org/request/2.11.4
npm http GET https://registry.npmjs.org/optimist/0.3.4
npm http GET https://registry.npmjs.org/http-raw/1.1.0
npm http GET https://registry.npmjs.org/book/1.2.0
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/wordwrap
/usr/local/bin/lt -> /usr/local/lib/node_modules/localtunnel/bin/client
localtunnel@0.0.4 /usr/local/lib/node_modules/localtunnel
├── book@1.2.0
├── http-raw@1.1.0
├── request@2.11.4
└── optimist@0.3.4 (wordwrap@0.0.2)

Usage

So, let's say you want to make public your app available on http://localhost:3000 to receive different pings.

$ lt --port 3000
your url is: http://sygm.localtunnel.me

If you point your browser to the public URL http://sygm.localtunnel.me, you will see your local app! By setting ping_url=http://sygm.localtunnel.me/coconut/ping in your API calls, Coconut will be able to request your local web server.



Any Comment? Send us a message on Twitter @opencoconut
If you have questions or feedbacks, you can also contact us via our contact page