Project code
Class architecture
Introduction
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
Background
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) { Dispose();
return;
}
HttpQuery += Encoding.ASCII.GetString(Buffer, 0, Ret);
HeaderFields = ParseQuery(HttpQuery);
if (HeaderFields == null || !HeaderFields.ContainsKey("Host"))
{
SendBadRequest();
return;
}
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));
else
Port = 443;
}
else
{
Host = RequestedPath;
Port = 443;
}
}
else
{ Ret = ((string)HeaderFields["Host"]).IndexOf(":");
if (Ret > 0)
{
Host = ((string)HeaderFields["Host"]).Substring(0, Ret);
Port = int.Parse(((string)HeaderFields["Host"]).Substring(Ret + 1));
}
else
{
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.
History
- 10th April, 2010: Initial post