Simple localhost/proxy Server

Discussion in 'Python' started by Fuzzyman, Jul 23, 2004.

  1. Fuzzyman

    Fuzzyman Guest

    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
     
    Fuzzyman, Jul 23, 2004
    #1
    1. Advertising

  2. "Fuzzyman" <> wrote in message
    news:...
    > 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.
     
    Nick Smallbone, Jul 23, 2004
    #2
    1. Advertising

  3. Fuzzyman

    Fuzzyman Guest

    [snip..]

    > > 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.


    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
     
    Fuzzyman, Jul 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiong Feng
    Replies:
    0
    Views:
    837
    Jiong Feng
    Nov 19, 2003
  2. Alex
    Replies:
    4
    Views:
    571
    Hasani Blackwell
    Feb 8, 2005
  3. =?Utf-8?B?S2VuTGVl?=
    Replies:
    5
    Views:
    2,716
  4. EdwardH

    Localhost isn't localhost

    EdwardH, Sep 29, 2005, in forum: Java
    Replies:
    20
    Views:
    6,407
    Roedy Green
    Oct 1, 2005
  5. koicat
    Replies:
    0
    Views:
    228
    koicat
    Jul 2, 2010
Loading...

Share This Page