View Single Post
Old Feb 18th, 2006, 10:26 AM   #3
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Since this is the Java forum, I'll hazard a guess and say he wants to program it in Java

public static void main(String[] args) 
	throws IOException, MalformedURLException
{
	URL url = new URL("http://www.monkeyengines.co.uk");
	
	BufferedReader reader = new BufferedReader(
			new InputStreamReader(url.openStream())
	);
	while (true)
	{
		String line = reader.readLine();
		
		if (line == null) {
			break;
		}
		System.out.println(line);
	}
}
That's some simple code to get the source from a URL. What I guess you want is some sort of HTTP proxy...

Have you thought of using a prewritten HTTP proxy? Some of them are pretty flexible.

Here's a page that lists some java-based HTTP proxies.
Arevos is offline   Reply With Quote