A Simple Http Proxy Server
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.

Comments
proxy server using multithreading
Posted by appleapplemanthra12345 on 07/06/2010 12:45pmConnectingto internet problem
Posted by nwadmin on 02/24/2005 11:02pmIn 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.
ReplyReason why some sites do not work
Posted by Legacy on 02/10/2004 12:00amOriginally 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,
ReplyDerek
to use only with http/1.0
Posted by Legacy on 11/14/2003 12:00amOriginally posted by: Eduard
this program like the http 1.0 connections, setting up your browsers. thank you!
ReplyHow to run this program?
Posted by Legacy on 09/21/2003 12:00amOriginally 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?
ReplyProblem with remote server to proxy
Posted by Legacy on 02/21/2003 12:00amOriginally 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?
-
-
ReplyWhy didn't anyone answer this question?????
Posted by nwadmin on 03/06/2005 11:19pmI 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?
ReplyConnect to Internet: the problem
Posted by nwadmin on 02/24/2005 11:00pmIn 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.
ReplyFree Proxy Server Like this for Win2k
Posted by Legacy on 10/02/2002 12:00amOriginally 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!
Replydoesn't work
Posted by Legacy on 09/21/2002 12:00amOriginally posted by: abdou
ReplyHow to interface ASP engine with a newly developed HTTP server
Posted by Legacy on 07/25/2002 12:00amOriginally posted by: sorry
Replycould u plz describe how to pass request for an .asp files to ASP engine from a newly developed HTTP server
can't execute
Posted by Legacy on 06/23/2002 12:00amOriginally posted by: gwyn
I was getting numerous error messages.
-------------------Configuration: Proxy - Win32 Debug--------------------
Linking...
Proxy.obj : error LNK2001: unresolved external symbol __imp__listen@8
Proxy.obj : error LNK2001: unresolved external symbol __imp__bind@12
Proxy.obj : error LNK2001: unresolved external symbol __imp__socket@12
Proxy.obj : error LNK2001: unresolved external symbol __imp__htons@4
Proxy.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
Proxy.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
Proxy.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
Proxy.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
Proxy.obj : error LNK2001: unresolved external symbol __imp__send@16
Proxy.obj : error LNK2001: unresolved external symbol __imp__recv@16
Proxy.obj : error LNK2001: unresolved external symbol __imp__accept@12
Proxy.obj : error LNK2001: unresolved external symbol __imp__connect@12
Proxy.obj : error LNK2001: unresolved external symbol __imp__gethostbyaddr@12
Proxy.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
Proxy.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/Proxy.exe : fatal error LNK1120: 17 unresolved externals
Error executing link.exe.
Proxy.exe - 18 error(s), 0 warning(s)
ReplyLoading, Please Wait ...