Setting up a proxy server

Discussion in 'macOS' started by nigels0, Nov 29, 2009.

  1. nigels0 macrumors member

    Joined:
    Feb 23, 2008
    #1
    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.
     
  2. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #2
    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
     
  3. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #3
    I must admit I was stumped at your first line - start SSH server on your UK Mac - how do I do that?
     
  4. Queso macrumors G4

    Joined:
    Mar 4, 2006
    #4
    Follow the instructions in the fourth post down on this MacNN thread

    Link

    EDIT : Oh yeah, and you'll need to set up a proxy. I used the Squidman app.
     
  5. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
  6. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #6
    oh right, maybe the http proxy approach is easier.

    Tex
     
  7. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #7
    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?
     
  8. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #8
    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.
     
  9. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #9
    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.
     
  10. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #10
    Did you check the box "Use this proxy for all protocols" in Firefox ?

    Im not sure if Squidman supports authentication.
     
  11. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #11
    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!
     
  12. Tex-Twil macrumors 68020

    Tex-Twil

    Joined:
    May 28, 2008
    Location:
    Europe
    #12
    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
     
  13. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #13
    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.
     
  14. nigels0 thread starter macrumors member

    Joined:
    Feb 23, 2008
    #14
    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.
     

Share This Page