2

I'm working on Facebook Credits API integration and still haven't found a solution of how to debug the Facebook Credits callback on localhost...

I will appreciate any idea of to do it.

Thanks a lot!

Roei
  • 319
  • 4
  • 15

2 Answers2

4

You can use a tool called localtunnel, it's an easy way to share localhost web servers to the rest of the world.

  1. Install it using RubyGems by running:

    $ sudo gem install localtunnel
    
  2. Run your local web server on any port! Let's say you're running Apache on port 8080.

  3. Run localtunnel passing it the port to share

    $ localtunnel 8080
    

    Note: the first time you run localtunnel you have to point to a public SSH key. Check the README if you need help.

    Here's an example:

    $ localtunnel -k ~/.ssh/id_rsa.pub 8080
    

    You should see something like this:

    Port 8080 is now publicly accessible from
    http://8bv2.localtunnel.com ...
    

Note: every time you stop your local web server you should run localtunnel again and update your Facebook app configuration.

Giovanni Cappellotto
  • 4,597
  • 1
  • 30
  • 33
0

You cannot use your localhost since facebook's public servers must use HTTP(S) to transfer and receive data from you callback file. You must host this file on a public facing server.

DSchultz
  • 1,335
  • 6
  • 15