ssh-tunnel on port 4007

I am using the facebooker gem to create a facebook application. To test it on my local machine I am opening a ssh-tunnel on port 4007 so that all the requests to that port get forwarded to my local machine. This is a facility offered by facebooker gem which takes the pain out of testing the application on local machine.

I have followed the instructions and it seems that the tunnel is created but when I access the site on port 4007 it just does not forward it to my local machine. I always tried taking the iptables down but no luck. What else can I do to fix the issue?

6 Replies

What command are you using to start the ssh tunnel?

I think I might know what is causing it. I am actually behind a router so I will have to ensure that router forwards any request it receives to my localhost on port 3000 because now router now refuses the connection. So, I think I need to configure my router.

@andhapp:

I think I might know what is causing it. I am actually behind a router so I will have to ensure that router forwards any request it receives to my localhost on port 3000 because now router now refuses the connection. So, I think I need to configure my router.
Are you initiating the ssh connection from behind the router? If so, there's no need to reconfigure the router.

Yeah, I am initiating it from behind the router. So, I don't need to reconfigure the router…interesting.

You asked about the command. I am just running the command provided by facebooker which kind of creates a tunnel so that anything that tries to come to my domain (im.andhapp.co.uk) running on linode on port 4007 to forward to my localhost running on port 3000. I am not sure how they are doing it internally but can you suggest what command should I be using for it and I will just run that and see if that works. There might be a bug in the facebooker gem.

@andhapp:

Yeah, I am initiating it from behind the router. So, I don't need to reconfigure the router…interesting.

You asked about the command. I am just running the command provided by facebooker which kind of creates a tunnel so that anything that tries to come to my domain (im.andhapp.co.uk) running on linode on port 4007 to forward to my localhost running on port 3000. I am not sure how they are doing it internally but can you suggest what command should I be using for it and I will just run that and see if that works. There might be a bug in the facebooker gem.

For that port forward, the command should be something like:

$ ssh -R 4007:localhost:3000 user@domain.com

If that's being generated from within this app, though, it may be hard to track this down.

Do you have any firewall running on your local machine?

@anderiv:

For that port forward, the command should be something like:

$ ssh -R 4007:localhost:3000 user@domain.com

If that's being generated from within this app, though, it may be hard to track this down.

Do you have any firewall running on your local machine?

Thanks.

Well, I tried the command that it seems to set uo the tunnel and I checked it using the facebooker gem (as it has a utility to check if a tunnel is created and is up) and it is all ok. So, now if I go to www.domain.com:4007 then it should forward me to localhost:3000. Is that correct?

But it does not. When I access www.domain.com:4007 in my browser it just says "Firefox can't connect to the server on this port".

So, ssh-tunnel works but do you think there is something in my iptables on my linode that is stopping it from working. Thanks for all your help.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct