Simple localhost/proxy Server

F

Fuzzyman

I am trying to write a small server program that will work on a
*client* machine as a localhost server. It should then act as a proxy
server but modify URLs fetched through it - so that the fetches go via
an external CGI proxy.... Understand all that ? :)

(I have a working CGI proxy that will remotely fetch web pages that I
can't access. The CGI proxy knows which page to fetch through the
PATH_INFO environment variable. What I'd like to do is write a little
server program that will sit on the client machine and modify URL
requests so that they go *via* the CGI proxy..).

So I have a few examples of proxy server programs - like tcpwatch and
the Tiny HTTP Debugging proxy - but I'm afraid my knowledge of http is
so little that I'm struggling to feel my way through. (Although I've
written a few CGIs..).

Can anyone point me in the right direction ?
A localhost server that I can get a response from with my browser -
and can see the requests coming in python - would be cool.

I run 'Tiny HTTP Proxy' by SUZUKI Hisao and it prints :
Any clients will be served...
Serving HTTP on 0.0.0.0 port 8000 ...

But can I get it to respond... can I jigger..........
I put 0.0.0.0 port 8000 as my proxy settings in IE, I
http://0.0.0.0:8000 or just plain 0.0.0.0 in the address bar...
nothing seems to make it respond...

Hmmm... out of my depth I'm afraid.


Regards,


Fuzzy

http://www.vooidspace.org.uk/atlantibots/pythonutils.html
 
N

Nick Smallbone

Fuzzyman said:
I am trying to write a small server program that will work on a
*client* machine as a localhost server. It should then act as a proxy
server but modify URLs fetched through it - so that the fetches go via
an external CGI proxy.... Understand all that ? :)

(I have a working CGI proxy that will remotely fetch web pages that I
can't access. The CGI proxy knows which page to fetch through the
PATH_INFO environment variable. What I'd like to do is write a little
server program that will sit on the client machine and modify URL
requests so that they go *via* the CGI proxy..).

So I have a few examples of proxy server programs - like tcpwatch and
the Tiny HTTP Debugging proxy - but I'm afraid my knowledge of http is
so little that I'm struggling to feel my way through. (Although I've
written a few CGIs..).

Can anyone point me in the right direction ?
A localhost server that I can get a response from with my browser -
and can see the requests coming in python - would be cool.

I run 'Tiny HTTP Proxy' by SUZUKI Hisao and it prints :
Any clients will be served...
Serving HTTP on 0.0.0.0 port 8000 ...

But can I get it to respond... can I jigger..........
I put 0.0.0.0 port 8000 as my proxy settings in IE, I
http://0.0.0.0:8000 or just plain 0.0.0.0 in the address bar...
nothing seems to make it respond...

Hmmm... out of my depth I'm afraid.

You won't get much luck trying to send packets to 0.0.0.0. Perhaps if you
try 127.0.0.1 port 8000 as your proxy.
 
F

Fuzzyman

[snip..]
You won't get much luck trying to send packets to 0.0.0.0. Perhaps if you
try 127.0.0.1 port 8000 as your proxy.

Right.. I suspected as much - unfortunately the proxy defaults to
0.0.0.0 - and I can't see a way of changing it. It's buried in the
innards of BaseHTTPServer which is the base class for the Tiny Proxy.

Regards,

Fuzzy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top