Skip to content

huiliang/proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxy - A simple transperent web proxy written in go.

This was written after my neighbours have taken it a bit too far using
my wireless and I wanted to have a bit of fun.  It was inspired by
upside-down-ternet[1].  :-)

src/proxy is the main proxy library.  This repository also includes
multiple simple proxies written using it:

	upsidedown flips every image requested through it.

	logger simply logs every request.

	rickroll takes a path to an flv file, and replaces every flv
	request with its contents.  i.e. it turns every youtube video
	into a rickroll.

they all listen on port 3128.

Look at src/logger or src/upsidedown for examples on how to write a
custom proxy.

To forward all web traffic to the machine running the proxy (in my case on
192.168.1.11:3128), I use the following iptables commands on the router:

iptables -t nat -A PREROUTING -s '!' 192.168.1.11 -p tcp --dport 80 -j DNAT --to 192.168.1.11:3128
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -d 192.168.1.11 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0/255.255.255.0 -d 192.168.1.11 -p tcp --dport 3128 -j ACCEPT

Exercises for the reader: inject js into all html pages.

[1] http://www.ex-parrot.com/pete/upside-down-ternet.html

About

A simple web proxy written in Go. Used primarily to mess with my neighbours. Needs updating.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%