Callback event error when testing locally

For discussion of the Poker Mavens server module and other administration topics
Post Reply
harrythree
Posts: 38
Joined: Sun Mar 01, 2015 4:20 pm

Callback event error when testing locally

Post by harrythree »

I'm trying to test the Hand event callback locally using Node.js as the server. It is running locally on port 8080. The Poker Mavens (Lite) server is running on a Windows Server 2008 on AWS EC2.

I have configured my firewall with Inbound and Outbound Rules for the PokerMavens Server. I can hit the API with no problem.

On my Node.js server I have a route set to accept POST events from /pmcb (this is the callback url of course).

I have Callback Events enabled with the URL pointing to http://localhost:8080/pmcb. I also have Hand event, Login event, and Logout event all set to Yes. But when I test to see if the callback is being fired I can see in my logs that I'm getting an error "Callback event error: Socket Error # 10061 Connection refused."

When I test the callback url running on the production server on Heroku (cloud platform for web apps), I can see that I'm receiving the parameters being returned from the Poker Mavens Server and no errors in the log.

It would be ideal to be able to test the callbacks locally. I feel like it's a firewall issue, but I can't figure out what I'm doing wrong.

Any help or advice would be appreciated!

Thanks,

Harry
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback event error when testing locally

Post by Kent Briggs »

What happens if you run a browser on the server and point it to http://localhost:8080/pmcb ?
harrythree
Posts: 38
Joined: Sun Mar 01, 2015 4:20 pm

Re: Callback event error when testing locally

Post by harrythree »

If I hit that URL using Postman (REST Client Chrome extension) as a POST request and send it data like Event, my endpoint on my server displays it as expected. If I hit that URL in my browser it won't be found (obv because that would be a GET request and my router is looking for POST requests).
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: Callback event error when testing locally

Post by Kent Briggs »

I don't have any experience with node.js so I can't help you with the rights management there. I have EasyPHP installed under localhost on my desktop system here. I can set my callback url to http://localhost/callback.php and it executes my php file without any problems.
harrythree
Posts: 38
Joined: Sun Mar 01, 2015 4:20 pm

Re: Callback event error when testing locally

Post by harrythree »

Thanks for the responses Ken, I'm an idiot! I don't know why I would think what I was trying would work...

For whatever reason your last reply made me realize I'm trying to connect to my local machine from a remote server. Obviously it's not going to work since localhost:8080 isn't accessible from the outside world. Which also makes sense why it ran fine on my production server (since that can be accessed anywhere).
Post Reply