Click here to Skip to main content
13,355,093 members (61,145 online)
Click here to Skip to main content
Add your own
alternative version


38 bookmarked
Posted 10 Apr 2010

Internet Magic (Proxy Server) Windows Application

, 10 Apr 2010
Rate this:
Please Sign up or sign in to vote.
Windows application which creates a proxy server to share Internet over any TCP/IP network

Project code

Class architecture



In any network, each system has a unique IP address which identifies the system in the network. This application aims at distributing the internet over a network, based on the IP address. Administrator registers the IP addresses of the client in the application (proxy server), which then allows access to the various services provided by the server on the systems identified by these IP addresses.

This project is being developed using C# .NET in Visual Studio 2005.

Feature Set

  • IP address based internet sharing
  • Network monitoring to monitor online client activity
  • Web filter which can be used to block specified web sites
  • Time scheduling to limit client’s on-line time
  • Bandwidth usage statistics to monitor the bandwidth
  • Account authentication for Socks protocol
  • Socks support allows various internet messengers and FTP downloaders
  • Portmap maps a port on a specific IP address to another port on another IP address
  • This application also supports HTTP/FTP


In computer networks, a proxy server is a server (a computer system or an application program) that services the requests of its clients by forwarding requests to other servers. A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource, available from a different server. The proxy server provides the resource by connecting to the specified server and requesting the service on behalf of the client. A proxy server may optionally alter the client's request or the server's response, and sometimes it may serve the request without contacting the specified server. In this case, it would 'cache' the first request to the remote server, so it could save the information for later, and make everything as fast as possible. A proxy server that passes all requests and replies unmodified is usually called a gateway or sometimes tunnelling proxy. A proxy server can be placed in the user's local computer or at various points between the user and the destination servers or the Internet.

Using the Code

This application created using VS2005 code can directly open in Visual Studio using its Solution file.

The language used is C# using .NET 2.0, executable file will be created on program execution.

int Ret;
try  {
    Ret = ClientSocket.EndReceive(ar);
} catch {
    Ret = -1;
if (Ret <= 0) { //Connection is dead :(
HttpQuery += Encoding.ASCII.GetString(Buffer, 0, Ret);
/******************For Authentication************************/
HeaderFields = ParseQuery(HttpQuery);
if (HeaderFields == null || !HeaderFields.ContainsKey("Host"))
int Port;
string Host;

if (HttpRequestType.ToUpper().Equals("CONNECT"))
    Ret = RequestedPath.IndexOf(":");
    if (Ret >= 0)
        Host = RequestedPath.Substring(0, Ret);
        if (RequestedPath.Length > Ret + 1)
            Port = int.Parse(RequestedPath.Substring(Ret + 1));
            Port = 443;
        Host = RequestedPath;
        Port = 443;
{ //Normal HTTP
    Ret = ((string)HeaderFields["Host"]).IndexOf(":");
    if (Ret > 0)
        Host = ((string)HeaderFields["Host"]).Substring(0, Ret);
        Port = int.Parse(((string)HeaderFields["Host"]).Substring(Ret + 1));
        Host = (string)HeaderFields["Host"];
        Port = 80;
    if (HttpRequestType.ToUpper().Equals("POST"))
        int index = HttpQuery.IndexOf("\r\n\r\n");
        m_HttpPost = HttpQuery.Substring(index + 4);
string dir = Environment.CurrentDirectory;
if (!dir.Substring(dir.Length - 1, 1).Equals(@"\"))
    dir += @"\";
Program prx = Program.obj;


Points of Interest

The product is a very low cost system with a Windows application, where a system in which application is installed has a purpose to provide web services over the connected network. The administrator controlling this server has to give details of the client about their authorization to access these services and until when they can access it. The system then automatically generates a request window on client requesting access to the services which, if registered by administrator of server, then client can fully utilize the services provided by serve. Then system automatically controls the access time and monitors the client for their activity in the internet. After the validity period of the client has expired, then the client will be automatically barred from accessing these services.


  • 10th April, 2010: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

India India
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
Syed Javed16-Dec-11 7:44
memberSyed Javed16-Dec-11 7:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 10 Apr 2010
Article Copyright 2010 by shi123456
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid