I am working on a project to make web-based proxy using python and
mechanize .  I have a problem :
The page that mechanize returns, has URLS that are are not
Mechanized and if user clicks on it, they will go thourgh the link by
their own computer's ip (not the server that my code is installed on it) . is there any way to fix that ?
You can rewrite the urls, either by parsing the HTML with lxml, beautiful soup, etc - and then rewriting them and re-dumping the DOM to string before sending it to the user. Or by searching for URLs with regular expressions, and return a rewritten HTML.
keep in mind that doing it properly, with links generated by javascript, etc - is almost impossible.
That's why people use proxy servers.
how to mechnize the urls inside a returned page by mechanize in python?