A Simple Http Proxy Server

Environment: Visual C++ 6.0

This proxy program is a very simple console application to implement the HTTP proxy. It donot contain so much error tolerant code, so it is short. Run the proxy program, set your internet browser proxy server with correct ip and its port is 5060(default, defined in program as PROXYPORT), it should be work( I test it with IE4.0 and on Win98). Press 'q' will terminate the proxy program.

The program's structure is simple. For each request , it starts two threads, one is forward local data to remote server and the other is forward remote data to local machine.

Function UserToProxyThread(void *pParam) is to forward local data to remote server. It can be considered as server thread , when local request comes, it fork itself and read the coming data, then start another thread(ProxyToServer()) which connect to remote server. After remote server is connected, it read data from local machine and send it to remote machine. Meanwhile thread ProxyToServer , which can be considered as client, forward the remote server data to local machine.

Download source - 7KB



Comments

  • proxy and proxy scanner to feed(I.E)

    Posted by ferdy mambwe on 08/12/2014 04:25am

    Im completly newbie and inexperience,i want to write a simple excutable proxy server but it is taking me a lot of time and i get many errors.I want also a proxy scanner which can scan for these proxy and set automaticaly to I.E options, This looks very complex to me and as at now im being blocked from accessing one segment of lan and distance has being enlarged causing more interference making it hard and more difficult.Meanwhile,this is importan for me as it is helping to communicate before a stable solution . I will be happy if i receive a link to where i can download

    Reply
  • proxy server using multithreading

    Posted by appleapplemanthra12345 on 07/06/2010 12:45pm

    hello i want the proxy server program using multithreads...can any one help me how to write the code for my project(networking proggram)

    Reply
  • Connectingto internet problem

    Posted by nwadmin on 02/24/2005 11:02pm

    In my browser(IE)at client,when i type "www.google.com",I received this error : "...... Ifrom client Client connection to : www.google.akadns.net connect() failed:10060" How can i solve this problem.

    Reply
  • Reason why some sites do not work

    Posted by Legacy on 02/10/2004 12:00am

    Originally posted by: Derek

    Basically the gethostbyname is failing... just add the host/ip to your /etc/hosts for unix, or system32/drivers/etc/hosts for windoz.

    Cheers,
    Derek

    Reply
  • to use only with http/1.0

    Posted by Legacy on 11/14/2003 12:00am

    Originally posted by: Eduard

    this program like the http 1.0 connections, setting up your browsers. thank you!

    Reply
  • How to run this program?

    Posted by Legacy on 09/21/2003 12:00am

    Originally posted by: Wei Chen

    I complied the sourcecode with MS Visual 6 without any problem.

    Can someone tell me how to run this program? I mean should I do any setups?

    Reply
  • Problem with remote server to proxy

    Posted by Legacy on 02/21/2003 12:00am

    Originally posted by: Ujjal

    It worked fine with client( webbrowser) to proxy. Also worked fine with proxy to remote server( for eg. www.msn.com), I can see proxy receiving bytes from client, but when proxy tries to make connecton with remote server, it connects but it fails on recv() function. Does anyone know what is the problem with that? i think it uses port 80 every time it tries connection with remote server, is that a problem?

    • Why didn't anyone answer this question?????

      Posted by nwadmin on 03/06/2005 11:19pm

      I had also this fault : "It worked fine with client( webbrowser) to proxy. Also worked fine with proxy to remote server( for eg. www.msn.com), I can see proxy receiving bytes from client, but when proxy tries to make connecton with remote server, it connects but it fails on recv() function. Does anyone know what is the problem with that? i think it uses port 80 every time it tries connection with remote server, is that a problem?

      Reply
    • Connect to Internet: the problem

      Posted by nwadmin on 02/24/2005 11:00pm

      In my browser(IE)at client,when i type "www.google.com",I received this error : "...... Ifrom client Client connection to : www.google.akadns.net connect() failed:10060" How can i solve this problem.

      Reply
    Reply
  • Free Proxy Server Like this for Win2k

    Posted by Legacy on 10/02/2002 12:00am

    Originally posted by: AJ

    This software doesn't work very well in Win2k. I'm looking for something like this, but with the source code and it must work on Win2k, any suggestions?

    Thanks!

    Reply
  • doesn't work

    Posted by Legacy on 09/21/2002 12:00am

    Originally posted by: abdou

    i tried to execute the program but i got like 18 errors and i do not know to handle that.could you please help me with it?
    

    Reply
  • How to interface ASP engine with a newly developed HTTP server

    Posted by Legacy on 07/25/2002 12:00am

    Originally posted by: sorry


    could u plz describe how to pass request for an .asp files to ASP engine from a newly developed HTTP server

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Due to internal controls and regulations, the amount of long term archival data is increasing every year. Since magnetic tape does not need to be periodically operated or connected to a power source, there will be no data loss because of performance degradation due to the drive actuator. Read this white paper to learn about a series of tests that determined magnetic tape is a reliable long-term storage solution for up to 30 years.

Most Popular Programming Stories

More for Developers

RSS Feeds