Pi as a proxy server


13 posts
by Procura » Mon Nov 19, 2012 11:58 pm
I was looking to turn my raspberry pi into a proxy server to avoid restricted internet. I don't know much on the subject and any links to how proxy servers work or any arm software for the pi that could help. I plan on hosting it on my home connection and being able to use it during the day.
Posts: 13
Joined: Sat Nov 26, 2011 1:31 am
by rickseiden » Tue Nov 20, 2012 3:10 am
I run Dan's Guardian and Squid on an old Pentium 4 computer. Unfortunately, I don't remember how to set it up, otherwise I'd give you some detailed instructions. But it's a place to start.
There are 10 types of people in this world. Those that understand binary, and those that don't.
Posts: 398
Joined: Thu Aug 02, 2012 12:21 pm
Location: Buffalo, NY, USA
by gospaz » Tue Nov 20, 2012 4:38 am
Are you after a web proxy such as http://gospaz.info/zelune/ ( my site, its safe) or asystem wide proxy?
Posts: 5
Joined: Mon Nov 19, 2012 10:53 am
by Baldrick1 » Tue Nov 20, 2012 1:12 pm
Do you have SSH set up?

If so then that's all you need from the Pi side of things.

On the machine that you want to use a web browser on while proxying traffic through your Pi, install Putty.
Open Putty
Expand Connection > SSH > Tunnels
Click the "Dynamic" Radio button
Enter a port into "Source port", I use 1234
Click "Add"
You will now see "D1234" under forwarded ports
Now use SSH as normal to connect to your Pi from a remote connection (save the setup to save having to set this config each time)

Now open your web browser and go to your network settings, I use Firefox.
Under SOCKS Host, type in the IP of 127.0.0.1 and the port of 1234 (or whatever you chose above).

Traffic in Firefox will now go via an encrypted SSH session to your Pi and then onwards to the internet.


I think this is what you were after, sorry if it wasn't but it may still prove to be useful for someone else :)
Posts: 29
Joined: Thu Aug 02, 2012 3:37 pm
by Procura » Wed Nov 21, 2012 2:43 am
gospaz wrote:Are you after a web proxy such as http://gospaz.info/zelune/ ( my site, its safe) or asystem wide proxy?


A web based proxy would be optimal, I assume that all traffic coming in and out from my school would have to go through their proxy but I am uniformed and I don't know much about how these things work.
Posts: 13
Joined: Sat Nov 26, 2011 1:31 am
by gospaz » Wed Nov 21, 2012 2:46 am
I use mine for school, as you can not normally change system settings. All the web proxy is is an apache server with php and a script that you can download.
Posts: 5
Joined: Mon Nov 19, 2012 10:53 am
by Procura » Wed Nov 21, 2012 3:42 am
gospaz wrote:I use mine for school, as you can not normally change system settings. All the web proxy is is an apache server with php and a script that you can download.


So I could just run an Apache server and use some php scripts?

Edit: I found this project: http://phproxy-plus.sourceforge.net/
So now I will just look how to make a web server on the pi and use that script.
Last edited by Procura on Wed Nov 21, 2012 4:01 am, edited 1 time in total.
Posts: 13
Joined: Sat Nov 26, 2011 1:31 am
by gospaz » Wed Nov 21, 2012 3:49 am
Yeah, or you could use something like lighttpd as it is more resource friendly. Here is a well know script that I used to use http://sourceforge.net/projects/php-proxy/ . The one I currentley use requires a mysql database.
Posts: 5
Joined: Mon Nov 19, 2012 10:53 am
by mcgyver83 » Tue Nov 05, 2013 8:10 pm
In my school I cannot ssh (22) to my raspberry at home (I set port fwd right, from other less protected network I can connect fine to my rasp).
My idea is to use the rasp as proxy (using port 80 that is free) to tunnel all my http request (and also I'll be able to ssh to my rasp).
How can I do this?
Posts: 316
Joined: Fri Oct 05, 2012 11:49 am
by john564 » Tue Nov 05, 2013 10:49 pm
As said above, SSH is the easiest.
if the school block port 22, use port 80 for SSH
you can set up ssh over any port you like

And there are many other ways of setting up a proxy besides SSH
http://tryapi.wordpress.com/

phproxy, a webpage based proxy
openvpn,
Posts: 57
Joined: Tue Oct 30, 2012 7:05 am
by Virutas » Tue Dec 10, 2013 4:49 pm
Thanks Baldrick1 for your explanation. Works perfectly!!!
Posts: 25
Joined: Wed Sep 12, 2012 6:51 am
by mcgyver83 » Fri Feb 14, 2014 7:41 am
I'm a newbie, I'm using ubuntu and I'm now able to ssh into my rasp at home using sslh, how can I create a tunnel to use the rasp as proxy?
Posts: 316
Joined: Fri Oct 05, 2012 11:49 am
by DougieLawson » Fri Feb 14, 2014 7:59 am
OpenVPN is the server of choice. You need to port forward port 1194 and set-up the OpenVPN server listening for remote clients.
Hacker on ZX80, Microtan65, Raspberry Pis and Arduinos
Unemployed mainframe database troubleshooter
RPi owner since 2012.
Twitter: @DougieLawson

Gaffer tape is "The Force", it has a dark side and a light side and it holds the Universe together.
User avatar
Posts: 7300
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK