Setting up a proxy server

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
Hi,

I'm often away from the UK, but does anyone know a procedure to allow me to set up my Mac (which is always connected to the internet and I can get the IP address with Dyndns) to act as a proxy server so I can connect into the machine from my (remote) macbook and download from the UK?

I'm not particularly keen on using a public proxy as they seem to disappear on quite a regular basis.
 

Tex-Twil

macrumors 68020
May 28, 2008
2,477
10
Berlin
download from the BBC iPlayer?
Hi,
I'm not familiar with BBC iPlayer so I need to know 1st how it works. Is it a web based player ?

A solution is to use ssh sock proxy:

Basically what you have to do is the following
- start SSH server on your UK Mac
- check that the ssh port accessible from the internet
Then when you want to connect from your (remote) macbook

- connect with the ssh client to the ssh server
Code:
ssh  -D 7777 your_login@your_uk_mac_ip
This will open a port (here 7777) on your (remote) macbook.

Then you can setup your browser to connect via this port (localhost:7777) to the internet. This can be done in Firefox in the advanced settings.

If you need more details about any of the steps just ask.

cheers,
Tex
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
I must admit I was stumped at your first line - start SSH server on your UK Mac - how do I do that?
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
Thanks.

On the remote mac, I've set up the Squid proxy so it is listening on 8080 and changed my proxy settings to go through squid - and that works fine.

On the local machine though it doesn't seem to connect to squid.

Now, I can remotely access the remote computer using Terminal and the remote router confirms that it routes any access on port 22 to the remote mac. I've set up FireFox on the local computer to Socks V4 and set all the proxies to 127.0.0.1:2001 (which is the port I'm using on the ssh command).

Trying to access a web page on the local machine doesn't work though - it just hangs - so I think the request which is going through port 2001 isn't reaching the remote mac. Any thoughts?
 

Tex-Twil

macrumors 68020
May 28, 2008
2,477
10
Berlin
Thanks.

On the remote mac, I've set up the Squid proxy so it is listening on 8080 and changed my proxy settings to go through squid - and that works fine.

On the local machine though it doesn't seem to connect to squid.

Now, I can remotely access the remote computer using Terminal and the remote router confirms that it routes any access on port 22 to the remote mac. I've set up FireFox on the local computer to Socks V4 and set all the proxies to 127.0.0.1:2001 (which is the port I'm using on the ssh command).

Trying to access a web page on the local machine doesn't work though - it just hangs - so I think the request which is going through port 2001 isn't reaching the remote mac. Any thoughts?
It looks like you are mixing both method. If you use the Squid proxy, just set up your firefox to connect via the proxy by typing the public IP of your mac and port 8080. That's all.
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
Ah, now it's a bit clearer - but still haven't got it working.

Setting the remote IP address with port 8080 in FireFox on the local machine, and having the remote router forward port 8080 to the mac, I do get the request hitting the proxy, but I get the error:

1260041159.898 0 192.168.0.1 TCP_DENIED/403 3084 GET http://uk.finance.yahoo.com/currencies/converter/? - NONE/- text/html

in Squid on the remote machine, and Access Denied in Firefox on the local machine.

If I do get this working though, how can I put a password on the proxy - Squidman doesn't seem to have the option.
 

Tex-Twil

macrumors 68020
May 28, 2008
2,477
10
Berlin
Ah, now it's a bit clearer - but still haven't got it working.

Setting the remote IP address with port 8080 in FireFox on the local machine, and having the remote router forward port 8080 to the mac, I do get the request hitting the proxy, but I get the error:

1260041159.898 0 192.168.0.1 TCP_DENIED/403 3084 GET http://uk.finance.yahoo.com/currencies/converter/? - NONE/- text/html
Did you check the box "Use this proxy for all protocols" in Firefox ?

If I do get this working though, how can I put a password on the proxy - Squidman doesn't seem to have the option.
Im not sure if Squidman supports authentication.
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
Yes, all protocols - it was getting through to Squid, but squid had the error.

As I can't protect the proxy though, I would prefer the SSH approach. Can't get that working either!
 

Tex-Twil

macrumors 68020
May 28, 2008
2,477
10
Berlin
Yes, all protocols - it was getting through to Squid, but squid had the error.

As I can't protect the proxy though, I would prefer the SSH approach. Can't get that working either!
ok let's try the ssh approach.

Enable the "remote access" as shown in this screenshot and forward the port 22 on your uk router to your uk mac so that it is open to the internet.


Then have a look again at my 1st post and tell me where are you stuck.

Cheers,
TEx
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
Yes, did that - on the local machine, I ran the ssh command (ssh -D 7777 <login>@machine) and got a login into the remote machine and could view the home directory etc. leaving Terminal open, so the connection stayed open, I then started Firefox - adding localhost:7777 in Firefox as a proxy (for all connections) and switching to SOCKS v4.


But Firefox seems do nothing - just responds with a blank screen and done in the bottom left. It seems that Firefox believes that it has retrieved the page.
 

nigels0

macrumors member
Original poster
Feb 23, 2008
55
2
I think the fact that firefox thinks it has got the page may indicate that the remote machine returns an error - but I don't know where to see that error.
 

Similar threads

  • ryanbutterworth
8
Replies
8
Views
490
Replies
6
Views
576
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.