marcelp1
Posts: 129
Joined: Mon Jun 11, 2012 8:41 pm

Proxy Server

Thu Jun 14, 2012 2:11 pm

Hi all,

is it possible to run a Proxy Server on RPi?

If so, could anyone kindly post setup guide please with some
security that it can only be accessed while I am abroad?

Thank you in advance.

Wendo
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm

Re: Proxy Server

Fri Jun 15, 2012 1:08 am

Well squid is probably the place to start, apt-get install squid, assuming it's in a repository and runs on the pi.

For security while abroad your best bet is to setup a VPN connection and connect to that first, although unless you have a decent router that may not be an option, in which case you could use the port forwarding in SSH to forward over an SSH connection.

I wouldn't trust opening squid up to the internet even if it did only accept authenticated connections.

To do port forwarding use SSH you should only need to setup the client side SSH client, and then point your web browsers proxy settings to localhost and the port you've forwarded. PuTTY has these settings under "Tunnels"

marcelp1
Posts: 129
Joined: Mon Jun 11, 2012 8:41 pm

Re: Proxy Server

Fri Jun 15, 2012 9:54 am

Hi,

have not realised that there is so many types of proxies
http://en.wikipedia.org/wiki/Proxy_server
and its not as easy to set up so only I can access it and it can't be used by anyone else.

I would like to use it when abroad, to access iPlayer or (get_iplayer) or sites
like tvcatchup.com which require UK IP address to utilise my internet connection when not at home
I have Bandwidth (Up/Down) [kbps/kbps]: 1.256 / 9.966 at home as well if it is going to work
with it.

What type of proxy would be best for this?

And how would I then set up my Debian and Windows systems to use that proxy server?
(I am running XP and Debian on my laptop and trying to learn linux so I can leave world of Window$,
but find it challenging :)

Thanx in advance.

gme
Posts: 5
Joined: Fri May 18, 2012 4:29 pm

Re: Proxy Server

Fri Jun 15, 2012 12:36 pm

I am using Apache as a reverse proxy server to access a few internal devices I have on my network. It works perfectly fine and doesnt take up much resources.

havent tried a forward proxy yet.

janukss
Posts: 1
Joined: Fri Jun 15, 2012 5:56 pm

Re: Proxy Server

Fri Jun 15, 2012 6:00 pm

You can use ssh to make a SOCKS5 proxy and tunnel everything through it.

wifiuk
Posts: 35
Joined: Sat Mar 03, 2012 9:50 pm
Contact: Website

Re: Proxy Server

Fri Jul 27, 2012 10:52 am

i would be interested in this.

I have a Netgear DGN2000 that has the option to setup a VPN connection and i dont have a problem setting that up with a little help and googling, but what i will need advise on is getting this working with the raspberrypi.

At work we have a corporate proxy, would be interested in getting my pi setup as a proxy so i can tunnel stuff via that instead of the work network for certain things..
Free photoshop Tutorials - www.howtophotoshop.co.uk

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Proxy Server

Fri Jul 27, 2012 2:21 pm

SSH Tunnel would be the easiest to setup..all you need is the SSH server then connect to your Pi via ssh from a remote location using the -D flag.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

jdbennet
Posts: 96
Joined: Sun Jul 22, 2012 2:25 pm

Re: Proxy Server

Fri Jul 27, 2012 2:25 pm

Squid needs *lots* of RAM, probably not suitable.

stewartmoss
Posts: 2
Joined: Tue Jul 31, 2012 11:02 am

Re: Proxy Server

Tue Jul 31, 2012 11:08 am

You can change the memory usage of squid in the squid.conf file.

I ran mine plain vanilla as per default from "apt-get install squid"

8 Megs of ram does not seem too bad. Performance for single user browsing is fine. WIll try getting the entire company over to see what happens.

VmPeak: 8708 kB
VmSize: 8676 kB
VmLck: 0 kB
VmHWM: 5812 kB
VmRSS: 5812 kB
VmData: 5108 kB
VmStk: 136 kB
VmExe: 1000 kB
VmLib: 2088 kB
VmPTE: 12 kB
VmSwap: 0 kB

marcelp1
Posts: 129
Joined: Mon Jun 11, 2012 8:41 pm

Re: Proxy Server

Tue Sep 11, 2012 9:49 pm

SirLagz wrote:SSH Tunnel would be the easiest to setup..all you need is the SSH server then connect to your Pi via ssh from a remote location using the -D flag.

I have just tried:
ssh -D 1080 pi@xxxxxx.dlinkddns.com -p 41689
ssh -fND 1080 pi@xxxxxx.dlinkddns.com -p 41689 (this does not work)

and then changing in Chrome to Manual Proxy Configuration:
127.0.0.1:1080
Use the same proxy for all the protocols

but get error:
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

Any ideas where I go wrong?

gabello
Posts: 51
Joined: Sun Aug 05, 2012 8:02 pm

Re: Proxy Server

Wed Sep 12, 2012 12:58 pm

Note that ssh tunnel will allow you to create a SOCKS proxy, so make sure that you setup the SOCKS proxy to 127.0.0.1:1080 rather than standard http proxy.

Otherwise: ssh -D 1080 pi@xxxxxx.dlinkddns.com -p 41689 looks ok (I use putty on windows so not 100% sure if this is how the putty settings translate in command line)

marcelp1
Posts: 129
Joined: Mon Jun 11, 2012 8:41 pm

Re: Proxy Server

Sun Feb 03, 2013 10:28 am

So I finally managed to get it working, and it's so easy.

Looking round internet, using SSH can be used to
proxy anything ..... but for HTTP proxy here is what I did:

I am using Google Chrome on Windows and Linux as web browser with the HTTP proxy.
I have found nice tool to switch between http proxy traffic and
my local network called Tunnel Switch
https://github.com/oylbin/tunnel-switch
add it to you chrome://extensions/ then once installed into the Google Chrome
you will see in top right corner grey little icon of earth right click on it - Options
will take to Settings for it, just enable FIXED SERVER, socks5,127.0.0.1,8527
then left click on the icon and Google Chrome will route all the HTTP traffic thrugh
port 8527

Now you just need to ssh into your RaspberyPi:

From Linux machine:
is this command:
ssh -D 8527 pi@xxxxxx.dlinkddns.com -p 41689

pi - username to log in with
@xxxxxx.dlinkddns.com is the address where my Raspbery Pi is
-p 41689 is the open port that it is running on (if you have not changed it,
you do not need to use this option, but I would recommend doing it to stop script kids breaking in

From Windows machine:
the best program is PuTTY,
http://www.chiark.greenend.org.uk/~sgta ... nload.html
now fill in the Host Name (or IP address)
xxxxxx.dlinkddns.com

Port is either default 22 or 41689 in my case

Connection type is SSH

Then click on Connection -> SSH -> Tunnels
add 8527 to Source Port and click on Dynamic and Add button

and then back to Session and Open, you will get connected to your
RaspberryPi just log in and your HTTP traffic in Google Chrome
will be routed through your RaspberryPi and best thing is that you can
also control and work on your RPi while the session is open :)

marcelp1
Posts: 129
Joined: Mon Jun 11, 2012 8:41 pm

Re: Proxy Server - Windows Shortcut

Fri Feb 08, 2013 12:53 pm

HI,

I have created shortcut on desktop and in Target location - Shortcut Tab
"C:\Program Files\putty-0.62\putty.exe" -ssh pi@xxxxxx.dlinkddns.com -P 41689

is there a way to have the http proxy setting build into the command?

I have tried obvious adding -D 8527 at the end but that does not work :(
"C:\Program Files\putty-0.62\putty.exe" -ssh pi@xxxxxx.dlinkddns.com -P 41689 -D 8527

sxturner
Posts: 7
Joined: Fri Jan 04, 2013 6:18 pm

Re: Proxy Server - Windows Shortcut

Tue Feb 12, 2013 8:26 pm

marcelp1 wrote:HI,

I have created shortcut on desktop and in Target location - Shortcut Tab
"C:\Program Files\putty-0.62\putty.exe" -ssh pi@xxxxxx.dlinkddns.com -P 41689

is there a way to have the http proxy setting build into the command?
I'd suggest configuring a saved putty session via the putty UI - this appears to have the settings for proxy config you are looking for - and then use plink.exe, pointing at your saved session, as your ssh client.

So if you name your saved session "myproxyssh" your ssh command would be
"C:\Program Files\putty-0.62\plink.exe" myproxyssh

Hexark
Posts: 12
Joined: Sat Jul 28, 2012 4:03 pm

Re: Proxy Server

Sat Dec 06, 2014 4:15 am

Hi,

I've set up using putty as instructed. But I can't seem to connect.

I can SSH in without a problem.
But can't proxy.

Even "telnet locahost 1025" inside SHH shows "connection refused."

I've added dynamic port as well.

JMan07
Posts: 5
Joined: Thu May 21, 2015 10:15 pm

Re: Proxy Server

Wed Sep 02, 2015 7:42 pm

marcelp1 wrote:Hi,

have not realised that there is so many types of proxies
http://en.wikipedia.org/wiki/Proxy_server
and its not as easy to set up so only I can access it and it can't be used by anyone else.

I would like to use it when abroad, to access iPlayer or (get_iplayer) or sites
like tvcatchup.com which require UK IP address to utilise my internet connection when not at home
I have Bandwidth (Up/Down) [kbps/kbps]: 1.256 / 9.966 at home as well if it is going to work
with it.

What type of proxy would be best for this?

And how would I then set up my Debian and Windows systems to use that proxy server?
(I am running XP and Debian on my laptop and trying to learn linux so I can leave world of Window$,
but find it challenging :)

Thanx in advance.
The only problem with Linux is software availability. In terms of software availability, you really should either stick with Windows or get a Mac. I know Macs are expensive, but in my opinion, they're worth it; you get a great operating system, a wide selection of software(including Microsoft and Adobe software), and a computer which will work for 10 years.

HiroProtagonist
Posts: 212
Joined: Sat Jun 29, 2013 9:45 am

Re: Proxy Server

Wed Sep 02, 2015 11:19 pm

JMan07 wrote:a wide selection of software(including Microsoft and Adobe software)
You're saying that like it's a good thing.

Return to “Networking and servers”