SlideShare a Scribd company logo
1 of 82
WEB BLOCKER
A project report submitted in partial fulfillment
Of the requirements for the award of the Degree of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING
by
B.SRESHTA SHARON (690777056) K.ASHA DEVI (690777028)
P.V.S.SARANYA(690777047) S.NAVEEN KUMAR(690777054)
Under the guidance of
Ms. J. Sharmila Rani , M.Tech
Department of Computer Science & Engineering
RAGHU INSTITUTE OF TECHNOLOGY
APPROVED BY AICTE &AFFLIATED TO ANDHRA UNIVERSITY
DAKAMARRI, BHEEMUNIPATNAM MANDAL
VISAKHAPATNAM
April 2011-2012
WEB BLOCKER
A PROJECT REPORT
Submitted by
B. Sreshta Sharon (690777056)
K. Asha Devi (690777028)
P.V.S. Saranya (690777047)
S. NaveenKumar (690777054)
in partial fulfillment for the award of the degree
Of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAGHU INSTITUTE OF TECHNOLOGY
APPROVED BY AICTE & AFFILIATED TO ANDHRA UNIVERSITY
DAKAMARRI, BHEEMUNIPATNAM MANDAL
VISAKHAPATNAM-531162
APRIL 2011-2012
RAGHU INSTITUTE OF TECHNOLOGY
VISAKHAPATNAM-531162
BONAFIDE CERTIFICATE
This is to certify that the project report “WEB BLOCKER” is a bonafide work of
B.Sreshta Sharon (690777056), K.Asha Devi(690777028), P.V.S.Saranya (690777047), and
S.NaveenKumar(690777054) who carried out the project work under my supervision.
Sri. P.SHRAVAN KUMAR , M.Tech Ms.J.SHARMILARANI,M.Tech
HEAD OF THE DEPARTMENT, Supervisor
Associate Professor Assisstant Professor
Computer Science & Engg.Dept. Computer Science & Engg
Raghu Institute of Technology Raghu Institute of Technology
ACKNOWLEDGEMENT
I would like to thank all those people who helped me in successful completion of
the project “WEB BLOCKER”.
I would like to thank Sri. K.Raghu garu, Chairman of Raghu Institute of
Technology, for providing necessary facilities.
I would like to thank Sri. Ravi Prasad garu, Principal of Raghu Institute of
Technology for his immense support and motivation.
I would like to thank Sri. P. Shravan Kumar, Head Of the Department,
Computer Science Department of Raghu Institute of Technology, Dakamarri, for his
guidance. I have learnt so many things from him and he motivated me and strengthened
my confidence in doing the thesis.
I would like to thank Ms. J. Sharmila Rani (Internal Guide), Asst. Professor of
Raghu Institute of Technology for giving valuable suggestions. I have learnt so many
concepts under her guidance.
I would also thank all the faculty members who have been a constant source and
encouragement during the entire course of my study in this college.
B. SRESHTA SHARON (690777056)
K.ASHA DEV(690777028)
P.V.S.SARANYA (690777047)
S.NAVEEN KUMAR (690777054)
DECLARATION
I hereby declare that the project entitled “WEB BLOCKER” submitted for the B. Tech Degree
(Computer Science and Engineering) is my original work done during the academic year 2011-
2012.
Signature of the Student:
Name of the Student(s):
B. Sreshta Sharon K.Asha Devi
(690777056) (690777028)
P.V.S.Saranya S.Naveen Kumar
(690777047) ( 690777054)
Place: Dakamarri, Bheemunipatnam, Visakhapatnam
Date:
ABSTRACT
1.ABSTRACT
This project named “Web Proxy Server” has been developed to serve any
organization in accessing internet from behind a fire wall. The primary use of
proxy server is to allow internal clients of a network to access to the Internet from
behind a firewall. By using this web proxy server, anyone can access web with
increased fastness and without compromising security.
Web proxy server acts as an intermediary between a workstation user and
the Internet so that the organization can ensure security, administrative control, and
caching service. A proxy server is associated with or part of a gateway server that
separates the enterprise network from the outside network and a firewall server that
protects the enterprise network from outside intrusion.
An advantage of a proxy server is that its cache can serve all users. If one
or more Internet sites are frequently requested, these are likely to be in the proxy's
cache, which will improve user response time.
This project serves any organization to their employees in giving better
service in accessing internet, controlling their browser activity and protecting
intranet from outside threats, viruses and intrusions.
ii
TABLE OF CONTENTS
CHAPTER NO. TITLE PAGE NO
ABSTRACT i
1. INTRODUCTION 1
1.1 Existing System 1
1.2 Proposed System 2
2. REQUIREMENTS SPECIFICATION 3
2.1 Introduction 3
2.2 Functional Requirements 4
2.3 Non- Functional Requirements 4
2.4 System Requirements 5
2.4.1 Introduction 5
2.4.2 Hardware Requirements 5
2.4.3 Software Requirements 6
2.5 Description of the Project 7
2.6 Visual Basic .Net is Object Oriented 8
3. ANALYSIS 9
3.1 Problem Analysis 9
3.2 Problem Definition 9
3.3 Object Oriented Analysis 10
3.3.1 Use case Diagram/Functional Model 11
3.3.2 Activity Diagram 13
4. DESIGN 15
4.1 System Design 15
4.1.1Introduction 15
4.1.2 Identifying design goals 15
4.1.3 Class Diagram / Object Model 16
4.1.4 Dynamic Model 17
4.2 Object Design 24
4.3 Interface Design 25
4.3.1 Screen Shot 25
4.3.2 State chart Diagram 26
4.3.3 Component Diagram 28
4.3.4 Deployment Diagram 29
5. IMPLEMENTATION 30
6. OUTPUT SCREENS 45
7. TESTING 50
7.1 White Box Testing 51
7.2 Black Box Testing 51
8. CONCLUSION 63
9. REFERENCES 64
LIST OF TABLES
TABLE NO. TABLE NAME PAGE NO
Table 1.1 Test Case 1 51
Table 1.2 Test Case 2 52
Table 1.3 Test Case 3 52
Table 1.4 Test Case 4 53
Table 1.5 Test Case 5 53
Table 1.6 Test Case 6 54
Table 1.7 Test Case 7 54
LIST OF FIGURES
DIAGRAM NO. DIAGRAM NAME PAGENO
Fig 1.1 Use case view for Client 11
Fig 1.2 Use case view for Proxy Server 12
Fig 1.3 Use case view for Admin 12
Fig 1.4 Overall Use Case view 13
Fig 1.5 Activity Diagram 14
Fig 1.6 Sequence Diagram for page not in cache 18
Fig 1.7 Sequence Diagram for page in cache 19
Fig 1.8 Sequence Diagram for requesting restricted page 20
Fig 1.9 Collaboration Diagram for page not in cache 21
Fig 2.0 Collaboration Diagram for page in cache 22
Fig 2.1 Collaboration Diagram for requesting restricted page 23
Fig 2.2 Class Diagram 24
Fig 2.3 State chart Diagram 27
Fig 2.4 Component Diagram 28
Fig 2.5 Deployment Diagram 29
INTRODUCTION
2. INTRODUCTION
The Internet Usage is the most prominent need for the present day corporate offices,
educational institutes and almost all other sectors. This usage of internet at most cases is out of
control resulting in misuse of the time and resources of the organization. This shall be regulated
for the benefits of the organization as well as the benefits of the individuals too.
The regulation doesn’t mean blocking but a shielded usage and monitoring provision may
help in regulating ht internet usage. Thus we propose a tool that monitors and restricts the access
to the internet resources and as is guided by the admin of the tool.
This tool not only enables the admin to control or monitor the web usage of each client
on the network but also maintains a local copy of the web page frequently accessed and provides
it as and when needed without letting the server load or internet provider bothered with it. Thus
saving time, bandwidth and browsing cost.
2.1 Existing System:
The existing system contains no mediatory software between Internet and
intranet. So it suffers from the following disadvantages.
 Security problem
 Lack of control over the network users
 Poor performance
 Administrator can’t track users browsing habits in the same network
The following diagram illustrate how existing system working.
Normal Web Transaction
1
2.2 ProposedSystem:
To overcome the disadvantages of current system we propose a system called “Web
proxy server”.
“Server that acts as an intermediary between a workstation user and the Internet so that
the enterprise can ensure security, administrative control, and caching service. A proxy server is
associated with or part of a gateway server that separates the enterprise network from the outside
network and a firewall server that protects the enterprise network from outside intrusion.”
PPrrooppoosseedd ssyysstteemm ““WWeebb pprrooxxyy sseerrvveerr aarrcchhiitteeccttuurree::
22
REQUIREMENTS
3.REQUIREMENTS SPECIFICATION
3.1 Introduction:
A Software Requirements Specification (SRS) is a complete description of the behavior
of the system to be developed. It includes a set of use cases that describe all the interactions the
users will have with the software. Use cases are also known as functional requirements. In
addition to use cases, the SRS also contains non-functional (or supplementary) requirements.
Non-functional requirements are requirements which impose constraints on the design or
implementation (such as performance engineering requirements, quality standards, or design
constraints).
3.1 Functional Requirements:
In software engineering, a functional requirement defines a function of a software system
or its component. A function is described as a set of inputs, the behavior, and outputs. Functional
requirements may be calculations, technical details, data manipulation and processing and other
specific functionality that define what a system is supposed to accomplish. Behavioral
requirements describing all the cases where the system uses the functional requirements are
captured in use cases. Functional requirements are supported by non-functional requirements
(also known as quality requirements), which impose constraints on the design or implementation
(such as performance requirements, security, or reliability). How a system implements functional
requirements is detailed in the system design. In some cases a requirements analyst generates use
cases after gathering and validating a set of functional requirements. Each use case illustrates
behavioral scenarios through one or more functional requirements. Often, though, an analyst will
begin by eliciting a set of use cases, from which the analyst can derive the functional
requirements that must be implemented to allow a user to perform each use case.
3
Functional Requirements for Present Project:
 The access to remote websites and loading of page must be faster
 Unwanted websites should be restricted.
 Accessing privileges must be given according to the administrator
 A strong firewall must be implemented
 Reports are generated based on the entries or requests. Users are assigned
permissions/rights based on their roles.
3.3 Non Functional Requirements:
In systems engineering and requirements engineering, a non-functional requirement is a
requirement that specifies criteria that can be used to judge the operation of a system, rather than
specific behaviors. This should be contrasted with functional requirements that define specific
behavior or functions In general, functional requirements define what a system is supposed to do
whereas non-functional requirements define how a system is supposed to be. Non-functional
requirements are often called qualities of a system. Other terms for non-functional requirements
are "constraints", "quality attributes", "quality goals" and "quality of service requirements," and
"non-behavioral requirements."Qualities, that is, non-functional requirements, can be divided
into two main categories:
1. Execution qualities:
 Security: This tool provides security by blocking some websites.
 Usability: To use this tool the administrator has to login.
2. Evolution qualities: which are embodied in the static structure of the software
system.
 Testability: The system can be tested against any unauthorized sites being
accessed.
 Maintainability: This tool can be maintained easily with the use of a server
and number of clients.
4
 Extensibility: The system is flexible to changes under taken further and it
has to adopt these changes.
 Scalability: The system can handle the assigned work effectively and
efficiently.
3.4 System Requirements
3.4.1 Introduction:
To be used efficiently, all computer software needs certain hardware components or other
software resources to be present on a computer. These pre-requisites are known as system
requirements and are often used as a guideline as opposed to an absolute rule. Most software
defines two sets of system requirements: minimum and recommended. With increasing demand
for higher processing power and resources in newer versions of software, system requirements
tend to increase over time. Industry analysts suggest that this trend plays a bigger part in driving
upgrades to existing computer systems than technological advancements.
3.4.2 Hardware Requirements:
The most common set of requirements defined by any operating system or software
application is the physical computer resources, also known as hardware, A hardware
requirements list is often accompanied by a hardware compatibility list (HCL), especially in case
of operating systems. An HCL lists tested, compatible, and sometimes incompatible hardware
devices for a particular operating system or application. The following sub-sections discuss the
various aspects of hardware requirements.
Hardware Requirements for Present Project:
1. VDU: Monitor/ LCD TFT / Projector
2. Input Devices: Keyboard and Mouse
3. RAM: 512 MB
4. Processor: P4 or above
5. Storage: Less than 100 MB of HDD space.
5
3.4.3 Software Requirements:
Software Requirements deal with defining software resource requirements and pre-
requisites that need to be installed on a computer to provide optimal functioning of an
application. These requirements or pre-requisites are generally not included in the software
installation package and need to be installed separately before the software is installed.
Software Requirements for Present Project:
1. Operating System: Windows XP SP2 or above
2. Run-Time: .Net Framework 3.0 or above.
3.5 Description of the Project:
Caching: The basic idea in caching is simple: store the retrieved document into a local file for
further use so it won’t be necessary to connect to the remote server the next time that document
is requested.
What we have done?
Implemented the mechanism of On-demand caching, which means caching the
documents that are requested by the clients. A document can only get cached if it’s requested by
a user; if there are no accesses to a given doc it will not be cached
Caching the file when the request first appears:
6
Returning the files when it is in proxy cache:
Firewall: Provides controlled access and protects from unauthorized access.
Maintaining Log Files: We have successfully generated cache files and the log files for all the
actions performed.
Cache Files: These files contain information of all the information that has been accessed
on the internet.
Log Files: These files contain all the information needed for access control information
along with different parameters.
7
3.6 Visual Basic .Net is object oriented:
Visual Basic .Net (VB.NET), is an object-oriented computer programming language
that can be viewed as an evolution of the classic Visual Basic (VB) , which is implemented on
the .Net framework. Of course ,Visual Basic was designed for simplicity, it also meant that the
language evolved along a different path from C++ . With Visual Basic , creating applications
with various buttons, text boxes and other graphical gizmos was relatively straight forward.
Eventually classic Visual Basic .Net evolved and it was became complex as various
graphical tools, frameworks, wizards, code generators and templates were added to assist in the
lower-level tasks of Windows programming. The Visual Basic .Net Web Forms and the Window
Form designers permit a developer to easily create standardized interfaces.
The biggest change from VB to VB .Net is, VB .Net is object-oriented now as it
supports the features of OOPS such as polymorphism, inheritance, abstraction and encapsulation.
VB .Net now adds Console Applications to it apart from Windows and Web Applications. All
the built-in VB functionality now is encapsulated in namespace called System. VB .Net is
strongly typed which means that we need to declare them by default before using them. It also
supports multithreading. VB .Net now, supports structured exception handling.
Web Development is now an integral part of VB .Net making Web Forms and Web
Services two major types of applications. Everything we do in VB .Net involves objects in some
way or the other and everything is based on Object classes. Controls, Forms, Modules are the
types of classes.
8
ANALYSIS
4. ANALYSIS
4.1 Problem Analysis:
By using the existing system, there is no proper security provided to the websites or web
pages that are accessed by different clients.
4.2 Problem Definition:
To solve this problem, we need to block the required sites and protect the system from
accessing the internet from behind a firewall. The proxy server maintains the list of blocked sites
and hence when the client requests for that blocked site, it’s access will be denied.
 Feasibility Analysis: By blocking the required sites, the user can access the internet from
behind a firewall. Hence the systems are protected from unauthorized access.
 Functional Feasibility: The system is fully functional in all aspects , by protecting the
system from unauthorized users.
 Technical Feasibility: Technically, this tool is supported by the “.Net” framework.
 Economic Feasibility: Economically there is no problem.
 Development Feasibility: There is no risk in developing this project tool in “.Net”, with
the advanced versions.
9
4.3 OBJECT ORIENTED ANALYSIS
Object-oriented analysis (OOA) aims to model the problem domain, the problem
we want to solve by developing an object-oriented (OD) system. The source of the analysis is a
written requirements statement and/ or use cases, UML diagrams can be used to illustrate the
statements. An analysis model will not take into account implementation constraints, such as
concurrency, distribution, persistence or inheritance, nor how the system will be built. The model
of the system can be divide into multiple domains each of which are separately analyzed and
represent separate business, technological or conceptual areas of interest.
The UML has nine diagrams and these diagrams can be classified into static and
dynamic groups:
Static Diagrams:
1. Class Diagram
2. Object Diagrams
3. Diagrams
4. Deployment Diagrams
Dynamic Diagrams:
1. Use case Diagrams
2. Sequence Diagrams
3. Collaboration Diagrams
4. State Chart Diagrams
5. Activity Diagrams
10
4.3.1 Use Case Diagram/ Functional Model:
Shows a set of use cases, actors and their relationships. These diagrams illustrate the
static use case view of a system and are important in organizing and modeling the behaviors of a
system.
The use cases actors are connected using associations, generalization or dependency
relationships. We use an “include” relationship and it is a stereotyped dependency between the
use cases when we find commonalities in the system and to reduce the complexity of the system.
The two main components of a use case are actors and use cases.
Fig 1.1: Use case for Client
11
Fig 1.2: Use case for Proxy server manager
Fig 1.3: Use case for Admin
12
Maintain Statistics
Validation of request
Maintain cache database
Bring requested page from web
browser
<<include>>
Proxy Server
manager
Restrict websites
Restrict users
View statistics
Adminstrator
Restrict websites
Fig 1.4: Overall Use case Diagram
4.3.2 Activity Diagram:
Activity diagram shows the flow from one activity to another within a system. The
activities may be sequential or branching objects that act and are acted upon. These also show
the dynamic view of the system.
13
Fig 1.5: Activity Diagram for the system
14
DESIGN
5.Design
5.1 System Design:
5.1.1 Introduction:
Systems design is the process or art of defining the architecture, components, modules,
interfaces, and data for a system to satisfy specified requirements. One could see it as the
application of systems theory to product development.
System Design is the transformation of analysis model into system design model. During
system design, developers define the design goals of the project and decompose the system into
smaller subsystems that can be accomplished by individual teams.
5.1.2 Identifying Design Goals:
Performance Criteria:
o Response Time: When the client requests for any web site or page, it must be
accessible as soon as possible except for the blocked sites.
o Memory: This web proxy server occupies low amount of memory.
o Throughput: Depends on the number of clients connected.
Dependability Criteria:
o Robustness: This project tool is very flexible and robust.
o Availability: This tool of cache manager will provide backup for recently
accessed files.
o Safety: This is prevented from any unauthorized access from behind
a firewall.
15
Performance Criteria:
Portability: It can be implemented with a minimum of two systems.
Readability: The port number and the IP address of the server can be seen
below the server start up screen.
Traceability: The proxy server can find out and get the recently accessed
web page from the cache files which is maintained.
End User Criteria:
Utility: The admin i.e. the server can update the clients or remove them.
Usability: The client can view and access requested page if it is not
blocked.
5.1.3 Class Diagram/Object Model:
This shows a set of classes, interfaces, collaborations and their relationships. They are
used to give the static view of the system.
Classes are composed of three things: name, attributes and operations.
Association is a generic relationship between two classes and is modeled by a line
connecting the classes.
Aggregations indicate whole-part-of relationships.
Composition relationship means the class is a member of another class.
Generalization relationship means “is-a” relationship.
Objects:
o Entity Objects- IP addresses and node names of the clients.
o Control Objects: Cache file
o Boundary Objects: Access view.
16
5.1.4 Dynamic Model:
a) Sequence Diagram: A sequence diagram in Unified Modeling Language (UML) is a kind of
interaction diagram that shows how processes operate with one another and in what order. It is a
construct of a Message Sequence Chart. A sequence diagram shows, as parallel vertical lines
(lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the
messages exchanged between them, in the order in which they occur.
Object: They are typically named or instances of class.
Link: A link is a semantic connection among objects.
Lifeline: A vertical dashed line that represents the life time of the object.
Focus of Control: It is tall, thin rectangle that shows the period of time an object is performing
action.
Messages: It specifies communication between objects.
17
Fig 1.6: Sequence Diagram when a requested page is not in cache
18
Fig 1.7: Sequence Diagram when requested page is in cache
19
Fig 1.8: Sequence Diagram when restricted page is requested
20
b)Collaboration Diagram:
This diagram shows the structural organization of the objects that send and receive
messages. It shows a set of objects, links between objects ad messages sent and received by those
objects. They illustrate the dynamic view of a system.
Fig 1.9: Collaboration diagram when requested page is not in cache
21
Fig 2.0: Collaboration diagram when requested page is in cache
22
Fig 2.1: Collaboration diagram when restricted page is requested
23
5.2 Object Design
Object design involves identification of existing patterns and off-shelf
components present in the system. Description of the class interfaces is also done in the
system.
Specifying Types, Signatures and Visibility:
During this step, we define the types of attributes used in the system. The type specification
includes data types of the attributes used in the system.
Fig 2.2: Class Diagram
24
5.3 Interface Design: This deals with the user interface with the system.
5.3.1 Screen for admin login:
25
5.3.2 State chartDiagram:
State chart diagram model the dynamic behavior of individual classes or any other kind
of object. They show the sequence of states an object goes through during its lifetime.
Events: The first is an idle state where the process starts. The next states are arrived for events
like send request, confirm request. These changes are responsible for state changes or order
object.
Actions Performed: The objects remain in states for finite time. If one of them satisfies a
condition it performs an action or waits for an event. The actions cannot be interrupted as they
are atomic. They can be concurrent with other state.
States: Represent situations during the lifetime of an object. It is represented as a rectangle with
bounded corners.
Transition: A solid arrow represents the path between different states of an object.
Label the transaction that triggered it and the action that results from it.
Event/action
Initial State: A filled circle followed by an arrow represents the initial state of object.
Final State: An arrow pointing to a filled circle inside another circle represents the final state of
the object.
26
State
Fig 2.3: State Chart Diagram
27
5.3.3 ComponentDiagram:
In component diagram, the main purpose is to show the structural relationships
between the components of a system. In UML, components are considered autonomous,
encapsulated units within a system or subsystem that provide one or more interfaces. They are
larger design units that represent things that will be implemented using replaceable modules.
In component-based development (CMD), these diagrams offer architects a
natural format to begin modeling a solution. Component diagrams show an architect to verify
that a system’s required functionality is being implemented by components, thus ensuring that
the eventual system will be acceptable.
In addition, they are useful communication tools for various groups. They give a
clear understanding of the entire system involved.
Developers find the component diagram useful because it provides them with a
high-level, architectural view of the system that they will be building, which helps developers
begin formalizing a roadmap for the implementation, and make decisions about task assignments
and/or needed skill enhancement.
Fig 2.4: Component Diagram
28
5.3.4 Deployment Diagram:
The Deployment diagram specifies the physical replaceable part of the system and it also has
processing and memory capacity.
Fig 2.5: Deployment Diagram
29
IMPLEMENTATION
6.IMPLEMENTATION
CODE:
AboutBox.vb
Public NotInheritable Class AboutBox
Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles OKButton.Click
Me.Close()
End Sub
Private Sub AboutBox_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
LoginForm.vb
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class LoginForm
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Cancel.Click
Me.Close()
End Sub
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles OK.Click
Dim sqlCon As New SqlConnection(MyKit.GetConnectionString)
Dim sqlCmd As New SqlCommand
sqlCmd.Connection = sqlCon
sqlCmd.CommandText = String.Format(“select count(*) from slogin where sid={0} and
spwd=’{1}’”, UsernameTextBox.Text.Trim, PasswordTextBox.Text.Trim)
30
Dim c As Integer = 0
Try
sqlCon.Open()
c = Convert.ToInt32((sqlCmd.ExecuteScalar))
sqlCon.Close()
Catch ex As Exception
MsgBox("Error: Can Not Establish DataBase Connection! Possibly, Server Name or Data
Base User Name And Password Are Wrong!", MsgBoxStyle.Critical)
End Try
If c = 0 Then
MsgBox("Invalid User ID or Password!", MsgBoxStyle.Critical)
Else
MainScreen.Show()
Me.Close()
End If
End Sub
Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
LogViewer.vb
Imports System.Threading
Public Class LogViewer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
On Error GoTo handle
If MyKit.log.Count <> 0 Then
For Each line As Object In MyKit.log
RichTextBox1.AppendText(line.ToString)
Next
MyKit.log.Clear()
End If
handle:
Exit Sub
End Sub
31
Private Sub LogViewer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
MainScreen.vb
Imports System.Windows.Forms
Imports System.Threading
Imports System.Net
Public Class MainScreen
Dim th As Thread
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AboutToolStripMenuItem.Click
AboutBox.ShowDialog()
End Sub
Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolStripMenuItem1.Click
URLForm.ShowDialog()
End Sub
Private Sub MainScreen_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
LogViewer.MdiParent = Me
LogViewer.MdiParent.WindowState = FormWindowState.Maximized
LogViewer.Show()
th = New Thread(New ThreadStart(AddressOf ProxyServer.Start))
th.Name = "OurProxyServer"
ToolStripStatusLabel2.Text = Dns.GetHostName()
ToolStripStatusLabel4.Text =
Dns.GetHostEntry(Dns.GetHostName()).AddressList(0).ToString
End Sub
32
Private Sub StartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles StartToolStripMenuItem.Click, ToolStripButton1.Click
MyKit.log.Add(vbNewLine & "Server Start Attempted...")
th.Start()
MyKit.log.Add("Started!")
ToolStripStatusLabel8.Text = "Running..."
End Sub
Private Sub StopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles StopToolStripMenuItem.Click, ToolStripButton2.Click
MyKit.log.Add(vbNewLine & "Server Stop Attempted...")
ProxyServer.StopServer()
MyKit.log.Add(" Stoped!")
ToolStripStatusLabel8.Text = "Stopped"
End Sub
Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolStripMenuItem5.Click
Me.Close()
End Sub
Private Sub NodesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NodesToolStripMenuItem.Click
Systems.ShowDialog()
End Sub
End Class
MyKit.vb
Public Class MyKit
Public Shared log As New ArrayList
Public Shared Function GetConnectionString() As String
'Return "Data Source=BCAS;Initial Catalog=webproxy;Persist Security Info=True;User
ID=sa; password=aqura"
Return "Data Source=.SQLEXPRESS;AttachDbFilename=D:DotNet
ProjectDeliverables03 projectWebBlockerwebproxy_Data.MDF;Integrated
Security=True;User Instance=True"
End Function
End Class
33
ProxyClient.vb
Imports System
Imports System.Collections
Imports System.Data
Imports System.Data.SqlClient
Imports System.Diagnostics
Imports System.Text
Imports System.Threading
Imports System.Net
Imports System.Net.Sockets
Imports System.IO
Public Class ProxyClient
Public ipaddress As String
Public clref As TcpClient
Public s As Socket
Public cmd As New SqlCommand()
Public cmd1 As New SqlCommand()
Public con As SqlConnection
Public ds As DataSet
Public pcal As ArrayList
Public reqstr As String
Dim p1 As New SqlParameter()
Dim p2 As New SqlParameter()
Dim p3 As New SqlParameter()
Sub send(ByVal msg As String)
Dim b() As Byte
b = System.Text.Encoding.ASCII.GetBytes(msg)
s.Send(b)
End Sub
Sub send(ByVal b() As Byte)
s.Send(b)
End Sub
Function recieve() As String
On Error Resume Next
Dim b(1024) As Byte
Dim n As Integer
n = s.Receive(b)
Dim msg As String
msg = System.Text.Encoding.ASCII.GetString(b, 0, n)
Return msg
End Function
34
Sub InitInsertCacheParameters()
p1.SqlDbType = SqldbType.VarChar
p2.SqlDbType = SqlDbType.DateTime
p3.SqlDbType = SqlDbType.Decimal
p1.Size = 200
p3.Precision = 9
p3.Scale = 0
p1.ParameterName = "@url"
p2.ParameterName = "@downloadtime"
p3.ParameterName = "@ID"
p3.Direction = ParameterDirection.Output
cmd.Parameters.Add(p1)
cmd.Parameters.Add(p2)
cmd.Parameters.Add(p3)
cmd.CommandType = CommandType.StoredProcedure
'Name of stored Procedure.
cmd.CommandText = "INSERTCACHE"
End Sub
'Method used for DownLoading a WebPage using WebClient Class.
Function DownLoadPage() As Byte()
Dim size As Integer = 0
'download the page(html)
Dim wc As New WebClient
Dim b() As Byte
'Dim rserver As Integer = 0
' c => content
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::downloading from remote
server......")
MsgBox("Downloading from server", vbOKOnly)
'DownLoads data form Resource form specified URI(Universal Resource Identifier)
b = wc.DownloadData(reqstr)
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::........done")
MsgBox("Download completed", vbOKOnly)
'Releases all resources used by the System.ComponentModel.Component.
wc.Dispose()
size = b.Length
'insert into cache and retrieve new identity
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url inserted into cache ")
'download and save html content
'checks whether Directory is present or note
If (Not Directory.Exists("c:wpscache")) Then
Directory.CreateDirectory("c:wpscache")
End If
Dim origfilename As String = "c:wpscache" + "test.htm"
Dim fs As New FileStream(origfilename, FileMode.Create, FileAccess.Write)
35
Dim bw As New BinaryWriter(fs)
bw.Write(b)
fs.Close()
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::saved to cache......" +
origfilename)
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::saved size into
cachetable")
Return b
End Function
Public Sub ProcessRequest()
reqstr = recieve()
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::complete reqstr:" + reqstr)
' retrieving requrl from get (header)
Dim i, j As Integer
'Getting data From GetHeader
i = reqstr.IndexOf(" ")
j = reqstr.IndexOf(" ", i + 1)
reqstr = reqstr.Substring(i + 1, j - i - 1)
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url(reqstr) is " + reqstr)
If (NodeCheck() = False) Then
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::Node is blocked")
'Standard way of sending a Webpage to a client Using HTTP Protocol.
send("http/1.1 200 ok" & " " & vbCr & vbLf & vbCr & vbLf & "sorry! This current
system has no access to internet!")
s.Close()
ElseIf (FirewallCheck() = False) Then
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is not allowed")
'Standard way of sending a Webpage to a client Using HTTP Protocol.
send("http/1.1 200 ok" & " " & vbCr & vbLf & vbCr & vbLf & "sorry! u r denied access
to " + reqstr)
s.Close()
Else
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::Node is not blocked")
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is allowed")
Dim identity As Object = Nothing
'= CacheCheck()
If (identity Is Nothing) Then
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is not available in
cache")
36
Dim b() As Byte
Try
b = DownLoadPage()
'provides easy access to parts of URI
Dim u As Uri = New Uri(reqstr)
Dim c As String = ""
If ( _
u.PathAndQuery = "/" Or _
u.PathAndQuery.ToLower().EndsWith(".htm") Or _
u.PathAndQuery.ToLower().EndsWith(".html")) Then
c = System.Text.Encoding.ASCII.GetString(b, 0, b.Length)
send(c)
Else
send(b)
End If
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::downloaded
content sent to client")
s.Close()
Catch exp As Exception
s.Close()
MyKit.log.Add(vbNewLine & "Error Message" + exp.Message)
End Try
Else
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is available in
cache")
Dim fs As New FileStream("c:wpscache" + identity.ToString(), FileMode.Open,
FileAccess.Read)
Dim b(fs.Length) As Byte
Dim br As New BinaryReader(fs)
br.Read(b, 0, b.Length)
br.Close()
fs.Close()
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url retreived from
cache")
Dim u As New Uri(reqstr)
If ( _
u.PathAndQuery = "/" Or _
u.PathAndQuery.ToLower().EndsWith(".htm") Or _
u.PathAndQuery.ToLower().EndsWith(".html")) Then
Dim content As String = System.Text.Encoding.ASCII.GetString(b, 0, b.Length)
send(content)
Else
send(b)
End If
37
MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::cached content sent to
client")
'for hits table
s.Close()
End If
End If
pcal.Remove(Me)
End Sub
'used to verify whether the node is allowed or Not
Function NodeCheck() As Boolean
For Each r As DataRow In ds.Tables(1).Rows
If (r(0).Equals(ipaddress)) Then
Return Convert.ToBoolean(r(2))
End If
Next
Return False
End Function
'used to verify whether the Requested URL is allowed or Not
Function FirewallCheck() As Boolean
For Each r As DataRow In ds.Tables(0).Rows
MyKit.log.Add(vbNewLine & "Checking in... " & reqstr.ToLower() & " :: " &
r("url").ToString().ToLower())
If (reqstr.ToLower().IndexOf(r("url").ToString().ToLower()) <> -1) Then
Return False
End If
Next
Return True
End Function
'used to verify whether the Requested URL is present in cache or Not
Function CacheCheck() As Object
cmd1.CommandText = "select id from cachetable where url='" + reqstr.Trim() + "'"
Return cmd1.ExecuteScalar()
End Function
End Class
38
ProxyServer.vb
Imports System
Imports System.Collections
Imports System.Data
Imports System.Data.SqlClient
Imports System.Diagnostics
Imports System.Text
Imports System.Threading
Imports System.Net
Imports System.Net.Sockets
Imports System.IO
Public Class ProxyServer
Shared obj As New TcpListener(Dns.GetHostEntry(Dns.GetHostName()).AddressList(0),
50000)
Shared pcal As New ArrayList()
Shared MaxLimit As Integer = 20
Shared con As New SqlConnection()
Shared ds As New DataSet()
Shared da As SqlDataAdapter
Shared count As Integer = 0
Shared toStop As Boolean
Public Shared Function StopServer() As Boolean
toStop = True
While toStop
MyKit.log.Add(vbNewLine & "Attempting To stop...")
MsgBox("Attempting to stop", vbOKOnly)
End While
Return True
End Function
Public Shared Sub Start()
InitializeProxyServer()
toStop = False
While (Not toStop)
If (pcal.Count < MaxLimit) Then
Dim pc As New ProxyClient()
pcal.Add(pc)
MyKit.log.Add(vbNewLine & "waiting for client...")
MsgBox("Waiting for client", vbOKOnly)
pc.s = obj.AcceptSocket()
Dim tempidp As IPEndPoint = pc.s.RemoteEndPoint
pc.ipaddress = tempidp.Address.ToString()
39
pc.con = con
pc.ds = ds
pc.pcal = pcal
MyKit.log.Add(vbNewLine & pc.ipaddress)
MyKit.log.Add(vbNewLine & "...client connected")
MsgBox("Client is connected", vbOKOnly)
Dim th As New Thread(New System.Threading.ThreadStart(AddressOf
pc.ProcessRequest))
count += 1
th.Name = "Request_" & count
th.Start()
End If
End While
toStop = False
con.Close()
End Sub
Shared Sub InitializeProxyServer()
Try
obj.Start()
MyKit.log.Add(vbNewLine & "web server started")
con.ConnectionString = MyKit.GetConnectionString
con.Open()
da = New SqlDataAdapter("select * from urls", con)
da.Fill(ds, "urls")
da = New SqlDataAdapter("select * from systems", con)
da.Fill(ds, "systems")
MyKit.log.Add(vbNewLine & "copied firewall db into ds")
Catch ex As Exception
MyKit.log.Add(vbNewLine & ex.Message)
End Try
End Sub
End Class
SplashScreen.vb
Public NotInheritable Class SplashScreen
Private Sub SplashScreen_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
40
Systems.vb
Imports System.Windows.Forms
Imports System.Net
Imports System.Data
Imports System.Data.SqlClient
Public Class Systems
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim isLoading As Boolean
Private Sub Systems_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
con.ConnectionString = MyKit.GetConnectionString
cmd.Connection = con
ListView1.Items.Clear()
isLoading = True
con.Open()
cmd.CommandText = "select * from systems"
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
While dr.Read
Dim lv As New ListViewItem(dr.GetString(0))
lv.SubItems.Add(dr.GetString(1))
lv.Checked = dr.GetBoolean(2)
ListView1.Items.Add(lv)
End While
con.Close()
isLoading = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim lv As New ListViewItem(TextBox1.Text)
lv.SubItems.Add(TextBox2.Text)
lv.Checked = False
ListView1.Items.Add(lv)
con.Open()
cmd.CommandText = "insert into systems(ipaddress,nodename) values('" & TextBox1.Text
& "','" & TextBox2.Text & "')"
cmd.ExecuteNonQuery()
con.Close()
End Sub
41
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim l As ListViewItem = ListView1.SelectedItems(0)
con.Open()
cmd.CommandText = "delete from systems where ipaddress = '" & l.Text & "'"
cmd.ExecuteNonQuery()
con.Close()
ListView1.Items.Remove(l)
End Sub
Private Sub ListView1_ItemChecked(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemCheckedEventArgs) Handles ListView1.ItemChecked
If isLoading Then
Exit Sub
End If
Dim l As ListViewItem = e.Item
con.Open()
cmd.CommandText = "update systems set status=" & IIf(l.Checked, 1, 0) & " where
ipaddress = '" & l.Text & "'"
cmd.ExecuteNonQuery()
con.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Me.Close()
End Sub
End Class
URLForm.vb
Imports System.Windows.Forms
Imports System.Data
Imports System.Data.SqlClient
Public Class URLForm
Dim con As New SqlConnection(MyKit.GetConnectionString)
Dim cmd As New SqlCommand
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Cancel_Button.Click
42
Me.Close()
End Sub
Private Sub URLForm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
cmd.Connection = con
cmd.CommandText = "select * from urls"
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
ListBox1.Items.Add(dr.GetString(0))
End While
con.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim s As String
s = InputBox("Enter The URL ")
ListBox1.Items.Add(s)
cmd.CommandText = String.Format("insert into urls values('{0}')", s)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End Sub
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles OK_Button.Click
Dim s As String
s = ListBox1.SelectedItem
If Not s Is Nothing Then
ListBox1.Items.Remove(s)
cmd.CommandText = String.Format("delete from urls where url = '{0}'", s)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End If
End Sub
End Class
43
Databases Usedin our Project:
We have used a database named MyWebProxyDB.MDF, which contains the
following tables along with their attributes.
1. CacheTable- This will maintain id, url,download time and cache memory.
2. Slogin- Maintains sid, spwd of the administrator.
3. systems- Will contain IPaddress, node name and status of different clients.
4. url- This will maintain a list of urls that are blocked by the server.
44
OUTPUT
7.OUTPUT SCREENS
Administrator Login :
Server Window:
45
Adding the sites to be blocked by the server:
Adding the Clients in the network:
46
After adding the client to the server:
During client accessing:
47
Browser:
Debug Proxy Server:
48
Debug:
When client tries to access a blocked site:
49
TESTING
8.TESTING
Software testing is a critical elementof software quality assurance and represents
the ultimate view of the specification, design nad coding.In fact, testing is one step in the
software engineering process that could be viewd as destructive rather than constructive.
A stratergy for software testing integrates software test case design methods into a
well- planned series of steps that result in the successful construction of software.Testing is the
set of activities tht can be planned in advance and conducted systematically. The underlying
motivation of program testingis to affirm softwarer qualitywith methods that can economically
and effectively to both small and large-scale systems.
STRATERGICAPPROACHTO SOFTWARE TESTING:
The software engineering process can be viewed as spiral. Initially system engineering
defines the role of softwareand leads to software requirement analysis where the information
domain, functions, behavior, performance, constraints and validation criteria for software are
established. Moving inward into the spiral, we come t design and finally to coding.
To develop computer software we spiral I along steamlines that decrease the level of abstraction
on each tun.
A stratergy for software testing may also be viewed in context of the spiral. Unit testing
begins at the vertex of the spiral. And concentrates on each unit of the software as implemented
in the source code. Testing progress by moving outward along the spiral to integration testing,
where the focus is on design and the concentration of software architecture. Taking an another
turn outward on the spiral, we encounter validation testing where requirements established as
part of software requirements analysis are validated against the software that has been
constructed. Finally, we arrive at system testing, where the software and other system elements
are tested as a whole.
Test Case Generation involves in testing and every module of the software system by giving test
data. Related test cases for the system are as follows. First, the different conditions that need to
be tested along with the cases used for testing these conditions and expected outputs are given.
Next, each module is containing the data fields used for testing are also given. The results and
the actions to be performed after getting wrong or invalid results are the key aspects that are
taken into considerations in this phase of testing.
In the current project the test cases have been selected using the functional approach. The goal is
to test the different requirements are specified in the requirements specifications document. Test
cases have been selected for both valid and invalid inputs.
50
8.1 White Box Testing: In this type of testing, the changes in the operations are visible to the
user. In our project tool, using this testing, it is verified that the client nodes are connected
properly and also the there is proper manage of the URL’s. Hence, this test is successfully
performed.
8.2 Black Box Testing: In this type of testing, there is no visibility to the internal changes that
occur. In our tool, this test verifies whether the blocked sites are not accessed and the other sites
are accessible by the client in request. Hence, this test is also successfully verified.
The test cases prepared for testing the main modules of the current project are as follows:-
TEST CASE 1:
Test Aspect
Checking whether a new website can be
added to a firewall table or not.
Action performed
Type the domain name which you want to add
to the firewall database
Test Data
www.facebook.com
Expected Result
When the corresponding add button is clicked
the new web site should be added
Actual Result
A new web site is added if we look into the
firewall data base
Final Result
SUCCESS
Table 1.1
51
Test Screen 1:
52
TEST CASE 2:
Test Aspect
Checking whether an existing website can be
removed from firewall table or not.
Action performed
Type the domain name which you want to remove
from the firewall database
Test Data
www.google.com
Expected Result
When the corresponding delete button is clicked
the existing web site should be deleted
Actual Result
A new web site is deleted if we look into the
firewall data base
Final Result
SUCCESS
Table 1.2
Test Screen 2:
53
TEST CASE 3:
Test Aspect
Checking whether a new client can be added or
removed
Action performed
Type the IP address of the respective client
Test Data
192.168.254.66
Expected Result
Should be added or removed accordingly
Actual Result
Successfully added or removed the client based
on the instruction
Final Result
SUCCESS
Table 1.3
Test Screen 3:
54
TEST CASE 4:
Test Aspect
Checking whether a allowed webpage is being
properly downloaded or not in the browser
through our proxy server
Action performed
Type the domain name in the browser and request
it to be displayed.
Test Data
www.gmail.com
Expected Result
The webpage should be displayed properly
Actual Result
The requested webpage has been displayed
properly.
Final Result
Success
Table 1.4
55
Test Screen 4:
56
TEST CASE 5:
Test Aspect
Checking whether restricted webpage is blocked
or not
Action performed
Type the domain name which is not in cache
Test Data
www.google.com
Expected Result
Access should be denied
Actual Result
Requested web page is not displayed
Final Result
SUCCESS
Table 1.5
57
Test Screen 5:
58
TEST CASE 6:
Test Aspect
Checking whether requested web page which is
in cache , displays a message i.e. page from
cache or not
Action performed
Type the domain name which is in cache
Test Data
www.yahoomail.com
Expected Result
Should display the message that the requested
page is from cache
Actual Result
Requested web page is from cache is displayed
Final Result
SUCCESS
Table 1.6
59
Test Screen 6:
60
TEST CASE 7:
Test Aspect
Checking whether requested web page which is
not in cache , displays a message i.e. page from
remote server
Action performed
Type the domain name which is not in cache
Test Data
www.orkut.com
Expected Result
Should display the message that the requested
page is from server
Actual Result
Requested web page is from server is displayed
Final Result
SUCCESS
Table 1.7
61
Test Screen 7:
62
CONCLUSION
9. CONCLUSION
With the increase in the number of clients in a network, there might be a problem of
accessing unauthorized sites and sites which cause some problems, thereby increasing the
complexity. Reliability has to be maintained as more clients are used. Web Blocker is a tool that
can restrict the clients from accessing particular websites so that they can access internet from
behind a firewall. This increases security and performance.
With proper design and implementation, Web Blocker will be a very useful tool to
provide caching service, maintaining log files and acts as a firewall.
FUTURE SCOPE
Generally, to control access to websites in an intra network, a network administrator is
required continuously to monitor the services. By using the Web Blocker, even a lab in charge
can handle it with minimum knowledge as we develop a user interface screen through which he
can block and release.
63
10. REFERENCES
1. Object-Oriented Modeling and Design with UML by, Rumbaugh.
2. Object-Oriented Analysis and Design with Applications by, Booch.
3. Object-Oriented Software Engineering, Second Edition, by, Bernd Bruegge and Allen
H.Dutoit.
64

More Related Content

What's hot

IoT, M2M and IoT System Management
IoT, M2M and IoT System ManagementIoT, M2M and IoT System Management
IoT, M2M and IoT System ManagementVikram Nandini
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and AlgorithmsDeiptii Das
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Divya Tiwari
 
Cloud of things (IoT + Cloud Computing)
Cloud of things (IoT + Cloud Computing)Cloud of things (IoT + Cloud Computing)
Cloud of things (IoT + Cloud Computing)Zakaria Hossain
 
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...vtunotesbysree
 
Sensor Networks Introduction and Architecture
Sensor Networks Introduction and ArchitectureSensor Networks Introduction and Architecture
Sensor Networks Introduction and ArchitecturePeriyanayagiS
 
Comprehensive survey on routing protocols for IoT
Comprehensive survey on routing protocols for IoTComprehensive survey on routing protocols for IoT
Comprehensive survey on routing protocols for IoTsulaiman_karim
 
Data communication lab manual
Data communication lab manualData communication lab manual
Data communication lab manualNafe Singh Yadav
 
Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)Usha Mehta
 
zigbee technology
zigbee technology zigbee technology
zigbee technology N.CH Karthik
 
embedded systems architecture, programming and design raj kamal.pdf
embedded systems architecture, programming and design raj kamal.pdfembedded systems architecture, programming and design raj kamal.pdf
embedded systems architecture, programming and design raj kamal.pdfMolalegnBezie
 
Community detection in graphs
Community detection in graphsCommunity detection in graphs
Community detection in graphsNicola Barbieri
 
Issues in routing protocol
Issues in routing protocolIssues in routing protocol
Issues in routing protocolPradeep Kumar TS
 

What's hot (20)

IoT, M2M and IoT System Management
IoT, M2M and IoT System ManagementIoT, M2M and IoT System Management
IoT, M2M and IoT System Management
 
ATPG Methods and Algorithms
ATPG Methods and AlgorithmsATPG Methods and Algorithms
ATPG Methods and Algorithms
 
Iot architecture
Iot architectureIot architecture
Iot architecture
 
D2D - Device to Device Communication
D2D - Device to Device CommunicationD2D - Device to Device Communication
D2D - Device to Device Communication
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks
 
Cloud of things (IoT + Cloud Computing)
Cloud of things (IoT + Cloud Computing)Cloud of things (IoT + Cloud Computing)
Cloud of things (IoT + Cloud Computing)
 
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
VTU 5TH SEM CSE SOFTWARE ENGINEERING SOLVED PAPERS - JUN13 DEC13 JUN14 DEC14 ...
 
Fault simulation
Fault simulationFault simulation
Fault simulation
 
CoAP - Web Protocol for IoT
CoAP - Web Protocol for IoTCoAP - Web Protocol for IoT
CoAP - Web Protocol for IoT
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Sensor Networks Introduction and Architecture
Sensor Networks Introduction and ArchitectureSensor Networks Introduction and Architecture
Sensor Networks Introduction and Architecture
 
Comprehensive survey on routing protocols for IoT
Comprehensive survey on routing protocols for IoTComprehensive survey on routing protocols for IoT
Comprehensive survey on routing protocols for IoT
 
Ch1 1
Ch1 1Ch1 1
Ch1 1
 
Data communication lab manual
Data communication lab manualData communication lab manual
Data communication lab manual
 
Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)Design-for-Test (Testing of VLSI Design)
Design-for-Test (Testing of VLSI Design)
 
zigbee technology
zigbee technology zigbee technology
zigbee technology
 
embedded systems architecture, programming and design raj kamal.pdf
embedded systems architecture, programming and design raj kamal.pdfembedded systems architecture, programming and design raj kamal.pdf
embedded systems architecture, programming and design raj kamal.pdf
 
Community detection in graphs
Community detection in graphsCommunity detection in graphs
Community detection in graphs
 
Vector architecture
Vector architectureVector architecture
Vector architecture
 
Issues in routing protocol
Issues in routing protocolIssues in routing protocol
Issues in routing protocol
 

Viewers also liked

Raj Aphale Strategy Presentation
Raj Aphale Strategy PresentationRaj Aphale Strategy Presentation
Raj Aphale Strategy PresentationRaj Aphale
 
Language acquisition by Raquel Caiza
Language acquisition by Raquel CaizaLanguage acquisition by Raquel Caiza
Language acquisition by Raquel CaizaRaquelCaiza
 
Государственная услуга Государственная экспертиза проектной документации и ре...
Государственная услуга Государственная экспертиза проектной документации и ре...Государственная услуга Государственная экспертиза проектной документации и ре...
Государственная услуга Государственная экспертиза проектной документации и ре...The webportal of the Mayor and the Government of Moscow
 
DAAD Hochschulsommerkurs-Stipendien 2017
DAAD Hochschulsommerkurs-Stipendien 2017DAAD Hochschulsommerkurs-Stipendien 2017
DAAD Hochschulsommerkurs-Stipendien 2017Marvin Müller
 
Закон о внесении изменений в ЖК
Закон о внесении изменений в ЖКЗакон о внесении изменений в ЖК
Закон о внесении изменений в ЖКОльга Бердецкая
 
Communicative approach by Raquel Caiza
Communicative approach by Raquel CaizaCommunicative approach by Raquel Caiza
Communicative approach by Raquel CaizaRaquelCaiza
 
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to Hero
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to HeroAfacerea Ta - Cum poate livra IT-ul rezultate - From Zero to Hero
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to HeroClass IT
 
Physics reverberation
Physics  reverberationPhysics  reverberation
Physics reverberationSomya Tyagi
 

Viewers also liked (20)

CV.
CV.CV.
CV.
 
Prsentación skype
Prsentación skypePrsentación skype
Prsentación skype
 
PERFORMANCE EVALUATION OF DIFFERENT CLASSIFIER ON BREAST CANCER
PERFORMANCE EVALUATION OF DIFFERENT CLASSIFIER ON BREAST CANCERPERFORMANCE EVALUATION OF DIFFERENT CLASSIFIER ON BREAST CANCER
PERFORMANCE EVALUATION OF DIFFERENT CLASSIFIER ON BREAST CANCER
 
Raj Aphale Strategy Presentation
Raj Aphale Strategy PresentationRaj Aphale Strategy Presentation
Raj Aphale Strategy Presentation
 
Práctica 3
Práctica 3Práctica 3
Práctica 3
 
Angel muñoz martínez, práctica 4
Angel muñoz martínez, práctica 4Angel muñoz martínez, práctica 4
Angel muñoz martínez, práctica 4
 
Prática 2
Prática 2Prática 2
Prática 2
 
Language acquisition by Raquel Caiza
Language acquisition by Raquel CaizaLanguage acquisition by Raquel Caiza
Language acquisition by Raquel Caiza
 
Cherk_kray_25-13
Cherk_kray_25-13Cherk_kray_25-13
Cherk_kray_25-13
 
Государственная услуга Государственная экспертиза проектной документации и ре...
Государственная услуга Государственная экспертиза проектной документации и ре...Государственная услуга Государственная экспертиза проектной документации и ре...
Государственная услуга Государственная экспертиза проектной документации и ре...
 
Autoevaluacion ev final_tice
Autoevaluacion ev final_ticeAutoevaluacion ev final_tice
Autoevaluacion ev final_tice
 
Kaohsiung
KaohsiungKaohsiung
Kaohsiung
 
ndi c.v
ndi c.vndi c.v
ndi c.v
 
DAAD Hochschulsommerkurs-Stipendien 2017
DAAD Hochschulsommerkurs-Stipendien 2017DAAD Hochschulsommerkurs-Stipendien 2017
DAAD Hochschulsommerkurs-Stipendien 2017
 
Закон о внесении изменений в ЖК
Закон о внесении изменений в ЖКЗакон о внесении изменений в ЖК
Закон о внесении изменений в ЖК
 
Communicative approach by Raquel Caiza
Communicative approach by Raquel CaizaCommunicative approach by Raquel Caiza
Communicative approach by Raquel Caiza
 
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to Hero
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to HeroAfacerea Ta - Cum poate livra IT-ul rezultate - From Zero to Hero
Afacerea Ta - Cum poate livra IT-ul rezultate - From Zero to Hero
 
Procubito de cordon
Procubito de cordonProcubito de cordon
Procubito de cordon
 
Physics reverberation
Physics  reverberationPhysics  reverberation
Physics reverberation
 
Adapting to change
Adapting to changeAdapting to change
Adapting to change
 

Similar to Here are the key functional requirements for the web proxy server project:1. Client Authentication - The system must authenticate clients before allowing access to the internet through the proxy server. 2. Web Caching - Frequently accessed web pages should be cached locally by the proxy server to improve performance.3. Access Control - The system must allow the administrator to define access policies and restrict access to certain websites/categories. 4. Traffic Monitoring - The proxy server should monitor and log all internet traffic by clients to enable reports on usage.5. Performance Optimization - By caching content locally and acting as an intermediary, the proxy server should optimize traffic and improve response times for clients.6. High Av

automatic database schema generation
automatic database schema generationautomatic database schema generation
automatic database schema generationsoma Dileep kumar
 
quiz game project report.pdf
quiz game project report.pdfquiz game project report.pdf
quiz game project report.pdfzccindia
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report Kishan Maurya
 
HPH Project Report
HPH Project ReportHPH Project Report
HPH Project ReportMehul Jain
 
Hostel management system (5)
Hostel management system (5)Hostel management system (5)
Hostel management system (5)PRIYANKMZN
 
Minor Project Report On Intranet database
Minor Project Report On Intranet databaseMinor Project Report On Intranet database
Minor Project Report On Intranet databaseAnjeet Kumar
 
IRJET- Placement Portal
IRJET- Placement PortalIRJET- Placement Portal
IRJET- Placement PortalIRJET Journal
 
Hospital management system
Hospital management systemHospital management system
Hospital management systemMehul Ranavasiya
 
Project Report Online Test
Project Report Online TestProject Report Online Test
Project Report Online TestAbhishek Kumar
 
Slambook report
Slambook reportSlambook report
Slambook reportritu garg
 
Mvc architecture driven design and agile implementation of a web based softwa...
Mvc architecture driven design and agile implementation of a web based softwa...Mvc architecture driven design and agile implementation of a web based softwa...
Mvc architecture driven design and agile implementation of a web based softwa...ijseajournal
 
Online examination documentation
Online examination documentationOnline examination documentation
Online examination documentationWakimul Alam
 
E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)Badrul Alam
 
Root Cause Detection in a Service-Oriented Architecture
Root Cause Detection in a Service-Oriented ArchitectureRoot Cause Detection in a Service-Oriented Architecture
Root Cause Detection in a Service-Oriented ArchitectureSam Shah
 
Online examination system
Online examination system Online examination system
Online examination system IRJET Journal
 

Similar to Here are the key functional requirements for the web proxy server project:1. Client Authentication - The system must authenticate clients before allowing access to the internet through the proxy server. 2. Web Caching - Frequently accessed web pages should be cached locally by the proxy server to improve performance.3. Access Control - The system must allow the administrator to define access policies and restrict access to certain websites/categories. 4. Traffic Monitoring - The proxy server should monitor and log all internet traffic by clients to enable reports on usage.5. Performance Optimization - By caching content locally and acting as an intermediary, the proxy server should optimize traffic and improve response times for clients.6. High Av (20)

automatic database schema generation
automatic database schema generationautomatic database schema generation
automatic database schema generation
 
combinepdf
combinepdfcombinepdf
combinepdf
 
Cryptoghaphy
CryptoghaphyCryptoghaphy
Cryptoghaphy
 
quiz game project report.pdf
quiz game project report.pdfquiz game project report.pdf
quiz game project report.pdf
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report
 
HPH Project Report
HPH Project ReportHPH Project Report
HPH Project Report
 
Hostel management system (5)
Hostel management system (5)Hostel management system (5)
Hostel management system (5)
 
Minor Project Report On Intranet database
Minor Project Report On Intranet databaseMinor Project Report On Intranet database
Minor Project Report On Intranet database
 
IRJET- Placement Portal
IRJET- Placement PortalIRJET- Placement Portal
IRJET- Placement Portal
 
Hospital management system
Hospital management systemHospital management system
Hospital management system
 
Srs2 Job Portal
Srs2 Job PortalSrs2 Job Portal
Srs2 Job Portal
 
Project Report Online Test
Project Report Online TestProject Report Online Test
Project Report Online Test
 
Intranet database
Intranet databaseIntranet database
Intranet database
 
Online cet
Online cetOnline cet
Online cet
 
Slambook report
Slambook reportSlambook report
Slambook report
 
Mvc architecture driven design and agile implementation of a web based softwa...
Mvc architecture driven design and agile implementation of a web based softwa...Mvc architecture driven design and agile implementation of a web based softwa...
Mvc architecture driven design and agile implementation of a web based softwa...
 
Online examination documentation
Online examination documentationOnline examination documentation
Online examination documentation
 
E filling system (report)
E filling system (report)E filling system (report)
E filling system (report)
 
Root Cause Detection in a Service-Oriented Architecture
Root Cause Detection in a Service-Oriented ArchitectureRoot Cause Detection in a Service-Oriented Architecture
Root Cause Detection in a Service-Oriented Architecture
 
Online examination system
Online examination system Online examination system
Online examination system
 

Here are the key functional requirements for the web proxy server project:1. Client Authentication - The system must authenticate clients before allowing access to the internet through the proxy server. 2. Web Caching - Frequently accessed web pages should be cached locally by the proxy server to improve performance.3. Access Control - The system must allow the administrator to define access policies and restrict access to certain websites/categories. 4. Traffic Monitoring - The proxy server should monitor and log all internet traffic by clients to enable reports on usage.5. Performance Optimization - By caching content locally and acting as an intermediary, the proxy server should optimize traffic and improve response times for clients.6. High Av

  • 1. WEB BLOCKER A project report submitted in partial fulfillment Of the requirements for the award of the Degree of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE & ENGINEERING by B.SRESHTA SHARON (690777056) K.ASHA DEVI (690777028) P.V.S.SARANYA(690777047) S.NAVEEN KUMAR(690777054) Under the guidance of Ms. J. Sharmila Rani , M.Tech Department of Computer Science & Engineering RAGHU INSTITUTE OF TECHNOLOGY APPROVED BY AICTE &AFFLIATED TO ANDHRA UNIVERSITY DAKAMARRI, BHEEMUNIPATNAM MANDAL VISAKHAPATNAM April 2011-2012
  • 2. WEB BLOCKER A PROJECT REPORT Submitted by B. Sreshta Sharon (690777056) K. Asha Devi (690777028) P.V.S. Saranya (690777047) S. NaveenKumar (690777054) in partial fulfillment for the award of the degree Of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING RAGHU INSTITUTE OF TECHNOLOGY APPROVED BY AICTE & AFFILIATED TO ANDHRA UNIVERSITY DAKAMARRI, BHEEMUNIPATNAM MANDAL VISAKHAPATNAM-531162 APRIL 2011-2012
  • 3. RAGHU INSTITUTE OF TECHNOLOGY VISAKHAPATNAM-531162 BONAFIDE CERTIFICATE This is to certify that the project report “WEB BLOCKER” is a bonafide work of B.Sreshta Sharon (690777056), K.Asha Devi(690777028), P.V.S.Saranya (690777047), and S.NaveenKumar(690777054) who carried out the project work under my supervision. Sri. P.SHRAVAN KUMAR , M.Tech Ms.J.SHARMILARANI,M.Tech HEAD OF THE DEPARTMENT, Supervisor Associate Professor Assisstant Professor Computer Science & Engg.Dept. Computer Science & Engg Raghu Institute of Technology Raghu Institute of Technology
  • 4. ACKNOWLEDGEMENT I would like to thank all those people who helped me in successful completion of the project “WEB BLOCKER”. I would like to thank Sri. K.Raghu garu, Chairman of Raghu Institute of Technology, for providing necessary facilities. I would like to thank Sri. Ravi Prasad garu, Principal of Raghu Institute of Technology for his immense support and motivation. I would like to thank Sri. P. Shravan Kumar, Head Of the Department, Computer Science Department of Raghu Institute of Technology, Dakamarri, for his guidance. I have learnt so many things from him and he motivated me and strengthened my confidence in doing the thesis. I would like to thank Ms. J. Sharmila Rani (Internal Guide), Asst. Professor of Raghu Institute of Technology for giving valuable suggestions. I have learnt so many concepts under her guidance. I would also thank all the faculty members who have been a constant source and encouragement during the entire course of my study in this college. B. SRESHTA SHARON (690777056) K.ASHA DEV(690777028) P.V.S.SARANYA (690777047) S.NAVEEN KUMAR (690777054)
  • 5. DECLARATION I hereby declare that the project entitled “WEB BLOCKER” submitted for the B. Tech Degree (Computer Science and Engineering) is my original work done during the academic year 2011- 2012. Signature of the Student: Name of the Student(s): B. Sreshta Sharon K.Asha Devi (690777056) (690777028) P.V.S.Saranya S.Naveen Kumar (690777047) ( 690777054) Place: Dakamarri, Bheemunipatnam, Visakhapatnam Date:
  • 7. 1.ABSTRACT This project named “Web Proxy Server” has been developed to serve any organization in accessing internet from behind a fire wall. The primary use of proxy server is to allow internal clients of a network to access to the Internet from behind a firewall. By using this web proxy server, anyone can access web with increased fastness and without compromising security. Web proxy server acts as an intermediary between a workstation user and the Internet so that the organization can ensure security, administrative control, and caching service. A proxy server is associated with or part of a gateway server that separates the enterprise network from the outside network and a firewall server that protects the enterprise network from outside intrusion. An advantage of a proxy server is that its cache can serve all users. If one or more Internet sites are frequently requested, these are likely to be in the proxy's cache, which will improve user response time. This project serves any organization to their employees in giving better service in accessing internet, controlling their browser activity and protecting intranet from outside threats, viruses and intrusions. ii
  • 8. TABLE OF CONTENTS CHAPTER NO. TITLE PAGE NO ABSTRACT i 1. INTRODUCTION 1 1.1 Existing System 1 1.2 Proposed System 2 2. REQUIREMENTS SPECIFICATION 3 2.1 Introduction 3 2.2 Functional Requirements 4 2.3 Non- Functional Requirements 4 2.4 System Requirements 5 2.4.1 Introduction 5 2.4.2 Hardware Requirements 5 2.4.3 Software Requirements 6 2.5 Description of the Project 7 2.6 Visual Basic .Net is Object Oriented 8 3. ANALYSIS 9 3.1 Problem Analysis 9 3.2 Problem Definition 9 3.3 Object Oriented Analysis 10 3.3.1 Use case Diagram/Functional Model 11 3.3.2 Activity Diagram 13 4. DESIGN 15 4.1 System Design 15 4.1.1Introduction 15 4.1.2 Identifying design goals 15 4.1.3 Class Diagram / Object Model 16 4.1.4 Dynamic Model 17 4.2 Object Design 24 4.3 Interface Design 25 4.3.1 Screen Shot 25 4.3.2 State chart Diagram 26 4.3.3 Component Diagram 28 4.3.4 Deployment Diagram 29 5. IMPLEMENTATION 30 6. OUTPUT SCREENS 45 7. TESTING 50 7.1 White Box Testing 51
  • 9. 7.2 Black Box Testing 51 8. CONCLUSION 63 9. REFERENCES 64
  • 10. LIST OF TABLES TABLE NO. TABLE NAME PAGE NO Table 1.1 Test Case 1 51 Table 1.2 Test Case 2 52 Table 1.3 Test Case 3 52 Table 1.4 Test Case 4 53 Table 1.5 Test Case 5 53 Table 1.6 Test Case 6 54 Table 1.7 Test Case 7 54 LIST OF FIGURES DIAGRAM NO. DIAGRAM NAME PAGENO Fig 1.1 Use case view for Client 11 Fig 1.2 Use case view for Proxy Server 12 Fig 1.3 Use case view for Admin 12 Fig 1.4 Overall Use Case view 13 Fig 1.5 Activity Diagram 14 Fig 1.6 Sequence Diagram for page not in cache 18 Fig 1.7 Sequence Diagram for page in cache 19 Fig 1.8 Sequence Diagram for requesting restricted page 20 Fig 1.9 Collaboration Diagram for page not in cache 21 Fig 2.0 Collaboration Diagram for page in cache 22 Fig 2.1 Collaboration Diagram for requesting restricted page 23 Fig 2.2 Class Diagram 24 Fig 2.3 State chart Diagram 27 Fig 2.4 Component Diagram 28 Fig 2.5 Deployment Diagram 29
  • 12. 2. INTRODUCTION The Internet Usage is the most prominent need for the present day corporate offices, educational institutes and almost all other sectors. This usage of internet at most cases is out of control resulting in misuse of the time and resources of the organization. This shall be regulated for the benefits of the organization as well as the benefits of the individuals too. The regulation doesn’t mean blocking but a shielded usage and monitoring provision may help in regulating ht internet usage. Thus we propose a tool that monitors and restricts the access to the internet resources and as is guided by the admin of the tool. This tool not only enables the admin to control or monitor the web usage of each client on the network but also maintains a local copy of the web page frequently accessed and provides it as and when needed without letting the server load or internet provider bothered with it. Thus saving time, bandwidth and browsing cost. 2.1 Existing System: The existing system contains no mediatory software between Internet and intranet. So it suffers from the following disadvantages.  Security problem  Lack of control over the network users  Poor performance  Administrator can’t track users browsing habits in the same network The following diagram illustrate how existing system working. Normal Web Transaction
  • 13. 1 2.2 ProposedSystem: To overcome the disadvantages of current system we propose a system called “Web proxy server”. “Server that acts as an intermediary between a workstation user and the Internet so that the enterprise can ensure security, administrative control, and caching service. A proxy server is associated with or part of a gateway server that separates the enterprise network from the outside network and a firewall server that protects the enterprise network from outside intrusion.” PPrrooppoosseedd ssyysstteemm ““WWeebb pprrooxxyy sseerrvveerr aarrcchhiitteeccttuurree:: 22
  • 15. 3.REQUIREMENTS SPECIFICATION 3.1 Introduction: A Software Requirements Specification (SRS) is a complete description of the behavior of the system to be developed. It includes a set of use cases that describe all the interactions the users will have with the software. Use cases are also known as functional requirements. In addition to use cases, the SRS also contains non-functional (or supplementary) requirements. Non-functional requirements are requirements which impose constraints on the design or implementation (such as performance engineering requirements, quality standards, or design constraints). 3.1 Functional Requirements: In software engineering, a functional requirement defines a function of a software system or its component. A function is described as a set of inputs, the behavior, and outputs. Functional requirements may be calculations, technical details, data manipulation and processing and other specific functionality that define what a system is supposed to accomplish. Behavioral requirements describing all the cases where the system uses the functional requirements are captured in use cases. Functional requirements are supported by non-functional requirements (also known as quality requirements), which impose constraints on the design or implementation (such as performance requirements, security, or reliability). How a system implements functional requirements is detailed in the system design. In some cases a requirements analyst generates use cases after gathering and validating a set of functional requirements. Each use case illustrates behavioral scenarios through one or more functional requirements. Often, though, an analyst will begin by eliciting a set of use cases, from which the analyst can derive the functional requirements that must be implemented to allow a user to perform each use case. 3
  • 16. Functional Requirements for Present Project:  The access to remote websites and loading of page must be faster  Unwanted websites should be restricted.  Accessing privileges must be given according to the administrator  A strong firewall must be implemented  Reports are generated based on the entries or requests. Users are assigned permissions/rights based on their roles. 3.3 Non Functional Requirements: In systems engineering and requirements engineering, a non-functional requirement is a requirement that specifies criteria that can be used to judge the operation of a system, rather than specific behaviors. This should be contrasted with functional requirements that define specific behavior or functions In general, functional requirements define what a system is supposed to do whereas non-functional requirements define how a system is supposed to be. Non-functional requirements are often called qualities of a system. Other terms for non-functional requirements are "constraints", "quality attributes", "quality goals" and "quality of service requirements," and "non-behavioral requirements."Qualities, that is, non-functional requirements, can be divided into two main categories: 1. Execution qualities:  Security: This tool provides security by blocking some websites.  Usability: To use this tool the administrator has to login. 2. Evolution qualities: which are embodied in the static structure of the software system.  Testability: The system can be tested against any unauthorized sites being accessed.  Maintainability: This tool can be maintained easily with the use of a server and number of clients. 4
  • 17.  Extensibility: The system is flexible to changes under taken further and it has to adopt these changes.  Scalability: The system can handle the assigned work effectively and efficiently. 3.4 System Requirements 3.4.1 Introduction: To be used efficiently, all computer software needs certain hardware components or other software resources to be present on a computer. These pre-requisites are known as system requirements and are often used as a guideline as opposed to an absolute rule. Most software defines two sets of system requirements: minimum and recommended. With increasing demand for higher processing power and resources in newer versions of software, system requirements tend to increase over time. Industry analysts suggest that this trend plays a bigger part in driving upgrades to existing computer systems than technological advancements. 3.4.2 Hardware Requirements: The most common set of requirements defined by any operating system or software application is the physical computer resources, also known as hardware, A hardware requirements list is often accompanied by a hardware compatibility list (HCL), especially in case of operating systems. An HCL lists tested, compatible, and sometimes incompatible hardware devices for a particular operating system or application. The following sub-sections discuss the various aspects of hardware requirements. Hardware Requirements for Present Project: 1. VDU: Monitor/ LCD TFT / Projector 2. Input Devices: Keyboard and Mouse 3. RAM: 512 MB 4. Processor: P4 or above 5. Storage: Less than 100 MB of HDD space. 5
  • 18. 3.4.3 Software Requirements: Software Requirements deal with defining software resource requirements and pre- requisites that need to be installed on a computer to provide optimal functioning of an application. These requirements or pre-requisites are generally not included in the software installation package and need to be installed separately before the software is installed. Software Requirements for Present Project: 1. Operating System: Windows XP SP2 or above 2. Run-Time: .Net Framework 3.0 or above. 3.5 Description of the Project: Caching: The basic idea in caching is simple: store the retrieved document into a local file for further use so it won’t be necessary to connect to the remote server the next time that document is requested. What we have done? Implemented the mechanism of On-demand caching, which means caching the documents that are requested by the clients. A document can only get cached if it’s requested by a user; if there are no accesses to a given doc it will not be cached Caching the file when the request first appears: 6
  • 19. Returning the files when it is in proxy cache: Firewall: Provides controlled access and protects from unauthorized access. Maintaining Log Files: We have successfully generated cache files and the log files for all the actions performed. Cache Files: These files contain information of all the information that has been accessed on the internet. Log Files: These files contain all the information needed for access control information along with different parameters. 7
  • 20. 3.6 Visual Basic .Net is object oriented: Visual Basic .Net (VB.NET), is an object-oriented computer programming language that can be viewed as an evolution of the classic Visual Basic (VB) , which is implemented on the .Net framework. Of course ,Visual Basic was designed for simplicity, it also meant that the language evolved along a different path from C++ . With Visual Basic , creating applications with various buttons, text boxes and other graphical gizmos was relatively straight forward. Eventually classic Visual Basic .Net evolved and it was became complex as various graphical tools, frameworks, wizards, code generators and templates were added to assist in the lower-level tasks of Windows programming. The Visual Basic .Net Web Forms and the Window Form designers permit a developer to easily create standardized interfaces. The biggest change from VB to VB .Net is, VB .Net is object-oriented now as it supports the features of OOPS such as polymorphism, inheritance, abstraction and encapsulation. VB .Net now adds Console Applications to it apart from Windows and Web Applications. All the built-in VB functionality now is encapsulated in namespace called System. VB .Net is strongly typed which means that we need to declare them by default before using them. It also supports multithreading. VB .Net now, supports structured exception handling. Web Development is now an integral part of VB .Net making Web Forms and Web Services two major types of applications. Everything we do in VB .Net involves objects in some way or the other and everything is based on Object classes. Controls, Forms, Modules are the types of classes. 8
  • 22. 4. ANALYSIS 4.1 Problem Analysis: By using the existing system, there is no proper security provided to the websites or web pages that are accessed by different clients. 4.2 Problem Definition: To solve this problem, we need to block the required sites and protect the system from accessing the internet from behind a firewall. The proxy server maintains the list of blocked sites and hence when the client requests for that blocked site, it’s access will be denied.  Feasibility Analysis: By blocking the required sites, the user can access the internet from behind a firewall. Hence the systems are protected from unauthorized access.  Functional Feasibility: The system is fully functional in all aspects , by protecting the system from unauthorized users.  Technical Feasibility: Technically, this tool is supported by the “.Net” framework.  Economic Feasibility: Economically there is no problem.  Development Feasibility: There is no risk in developing this project tool in “.Net”, with the advanced versions. 9
  • 23. 4.3 OBJECT ORIENTED ANALYSIS Object-oriented analysis (OOA) aims to model the problem domain, the problem we want to solve by developing an object-oriented (OD) system. The source of the analysis is a written requirements statement and/ or use cases, UML diagrams can be used to illustrate the statements. An analysis model will not take into account implementation constraints, such as concurrency, distribution, persistence or inheritance, nor how the system will be built. The model of the system can be divide into multiple domains each of which are separately analyzed and represent separate business, technological or conceptual areas of interest. The UML has nine diagrams and these diagrams can be classified into static and dynamic groups: Static Diagrams: 1. Class Diagram 2. Object Diagrams 3. Diagrams 4. Deployment Diagrams Dynamic Diagrams: 1. Use case Diagrams 2. Sequence Diagrams 3. Collaboration Diagrams 4. State Chart Diagrams 5. Activity Diagrams 10
  • 24. 4.3.1 Use Case Diagram/ Functional Model: Shows a set of use cases, actors and their relationships. These diagrams illustrate the static use case view of a system and are important in organizing and modeling the behaviors of a system. The use cases actors are connected using associations, generalization or dependency relationships. We use an “include” relationship and it is a stereotyped dependency between the use cases when we find commonalities in the system and to reduce the complexity of the system. The two main components of a use case are actors and use cases. Fig 1.1: Use case for Client 11
  • 25. Fig 1.2: Use case for Proxy server manager Fig 1.3: Use case for Admin 12 Maintain Statistics Validation of request Maintain cache database Bring requested page from web browser <<include>> Proxy Server manager Restrict websites Restrict users View statistics Adminstrator Restrict websites
  • 26. Fig 1.4: Overall Use case Diagram 4.3.2 Activity Diagram: Activity diagram shows the flow from one activity to another within a system. The activities may be sequential or branching objects that act and are acted upon. These also show the dynamic view of the system. 13
  • 27. Fig 1.5: Activity Diagram for the system 14
  • 29. 5.Design 5.1 System Design: 5.1.1 Introduction: Systems design is the process or art of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. One could see it as the application of systems theory to product development. System Design is the transformation of analysis model into system design model. During system design, developers define the design goals of the project and decompose the system into smaller subsystems that can be accomplished by individual teams. 5.1.2 Identifying Design Goals: Performance Criteria: o Response Time: When the client requests for any web site or page, it must be accessible as soon as possible except for the blocked sites. o Memory: This web proxy server occupies low amount of memory. o Throughput: Depends on the number of clients connected. Dependability Criteria: o Robustness: This project tool is very flexible and robust. o Availability: This tool of cache manager will provide backup for recently accessed files. o Safety: This is prevented from any unauthorized access from behind a firewall. 15
  • 30. Performance Criteria: Portability: It can be implemented with a minimum of two systems. Readability: The port number and the IP address of the server can be seen below the server start up screen. Traceability: The proxy server can find out and get the recently accessed web page from the cache files which is maintained. End User Criteria: Utility: The admin i.e. the server can update the clients or remove them. Usability: The client can view and access requested page if it is not blocked. 5.1.3 Class Diagram/Object Model: This shows a set of classes, interfaces, collaborations and their relationships. They are used to give the static view of the system. Classes are composed of three things: name, attributes and operations. Association is a generic relationship between two classes and is modeled by a line connecting the classes. Aggregations indicate whole-part-of relationships. Composition relationship means the class is a member of another class. Generalization relationship means “is-a” relationship. Objects: o Entity Objects- IP addresses and node names of the clients. o Control Objects: Cache file o Boundary Objects: Access view. 16
  • 31. 5.1.4 Dynamic Model: a) Sequence Diagram: A sequence diagram in Unified Modeling Language (UML) is a kind of interaction diagram that shows how processes operate with one another and in what order. It is a construct of a Message Sequence Chart. A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. Object: They are typically named or instances of class. Link: A link is a semantic connection among objects. Lifeline: A vertical dashed line that represents the life time of the object. Focus of Control: It is tall, thin rectangle that shows the period of time an object is performing action. Messages: It specifies communication between objects. 17
  • 32. Fig 1.6: Sequence Diagram when a requested page is not in cache 18
  • 33. Fig 1.7: Sequence Diagram when requested page is in cache 19
  • 34. Fig 1.8: Sequence Diagram when restricted page is requested 20
  • 35. b)Collaboration Diagram: This diagram shows the structural organization of the objects that send and receive messages. It shows a set of objects, links between objects ad messages sent and received by those objects. They illustrate the dynamic view of a system. Fig 1.9: Collaboration diagram when requested page is not in cache 21
  • 36. Fig 2.0: Collaboration diagram when requested page is in cache 22
  • 37. Fig 2.1: Collaboration diagram when restricted page is requested 23
  • 38. 5.2 Object Design Object design involves identification of existing patterns and off-shelf components present in the system. Description of the class interfaces is also done in the system. Specifying Types, Signatures and Visibility: During this step, we define the types of attributes used in the system. The type specification includes data types of the attributes used in the system. Fig 2.2: Class Diagram 24
  • 39. 5.3 Interface Design: This deals with the user interface with the system. 5.3.1 Screen for admin login: 25
  • 40. 5.3.2 State chartDiagram: State chart diagram model the dynamic behavior of individual classes or any other kind of object. They show the sequence of states an object goes through during its lifetime. Events: The first is an idle state where the process starts. The next states are arrived for events like send request, confirm request. These changes are responsible for state changes or order object. Actions Performed: The objects remain in states for finite time. If one of them satisfies a condition it performs an action or waits for an event. The actions cannot be interrupted as they are atomic. They can be concurrent with other state. States: Represent situations during the lifetime of an object. It is represented as a rectangle with bounded corners. Transition: A solid arrow represents the path between different states of an object. Label the transaction that triggered it and the action that results from it. Event/action Initial State: A filled circle followed by an arrow represents the initial state of object. Final State: An arrow pointing to a filled circle inside another circle represents the final state of the object. 26 State
  • 41. Fig 2.3: State Chart Diagram 27
  • 42. 5.3.3 ComponentDiagram: In component diagram, the main purpose is to show the structural relationships between the components of a system. In UML, components are considered autonomous, encapsulated units within a system or subsystem that provide one or more interfaces. They are larger design units that represent things that will be implemented using replaceable modules. In component-based development (CMD), these diagrams offer architects a natural format to begin modeling a solution. Component diagrams show an architect to verify that a system’s required functionality is being implemented by components, thus ensuring that the eventual system will be acceptable. In addition, they are useful communication tools for various groups. They give a clear understanding of the entire system involved. Developers find the component diagram useful because it provides them with a high-level, architectural view of the system that they will be building, which helps developers begin formalizing a roadmap for the implementation, and make decisions about task assignments and/or needed skill enhancement. Fig 2.4: Component Diagram 28
  • 43. 5.3.4 Deployment Diagram: The Deployment diagram specifies the physical replaceable part of the system and it also has processing and memory capacity. Fig 2.5: Deployment Diagram 29
  • 45. 6.IMPLEMENTATION CODE: AboutBox.vb Public NotInheritable Class AboutBox Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click Me.Close() End Sub Private Sub AboutBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class LoginForm.vb Imports System.Data Imports System.Data.Sql Imports System.Data.SqlClient Public Class LoginForm Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim sqlCon As New SqlConnection(MyKit.GetConnectionString) Dim sqlCmd As New SqlCommand sqlCmd.Connection = sqlCon sqlCmd.CommandText = String.Format(“select count(*) from slogin where sid={0} and spwd=’{1}’”, UsernameTextBox.Text.Trim, PasswordTextBox.Text.Trim) 30
  • 46. Dim c As Integer = 0 Try sqlCon.Open() c = Convert.ToInt32((sqlCmd.ExecuteScalar)) sqlCon.Close() Catch ex As Exception MsgBox("Error: Can Not Establish DataBase Connection! Possibly, Server Name or Data Base User Name And Password Are Wrong!", MsgBoxStyle.Critical) End Try If c = 0 Then MsgBox("Invalid User ID or Password!", MsgBoxStyle.Critical) Else MainScreen.Show() Me.Close() End If End Sub Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class LogViewer.vb Imports System.Threading Public Class LogViewer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick On Error GoTo handle If MyKit.log.Count <> 0 Then For Each line As Object In MyKit.log RichTextBox1.AppendText(line.ToString) Next MyKit.log.Clear() End If handle: Exit Sub End Sub 31
  • 47. Private Sub LogViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class MainScreen.vb Imports System.Windows.Forms Imports System.Threading Imports System.Net Public Class MainScreen Dim th As Thread Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click End End Sub Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click AboutBox.ShowDialog() End Sub Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click URLForm.ShowDialog() End Sub Private Sub MainScreen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load LogViewer.MdiParent = Me LogViewer.MdiParent.WindowState = FormWindowState.Maximized LogViewer.Show() th = New Thread(New ThreadStart(AddressOf ProxyServer.Start)) th.Name = "OurProxyServer" ToolStripStatusLabel2.Text = Dns.GetHostName() ToolStripStatusLabel4.Text = Dns.GetHostEntry(Dns.GetHostName()).AddressList(0).ToString End Sub 32
  • 48. Private Sub StartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartToolStripMenuItem.Click, ToolStripButton1.Click MyKit.log.Add(vbNewLine & "Server Start Attempted...") th.Start() MyKit.log.Add("Started!") ToolStripStatusLabel8.Text = "Running..." End Sub Private Sub StopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StopToolStripMenuItem.Click, ToolStripButton2.Click MyKit.log.Add(vbNewLine & "Server Stop Attempted...") ProxyServer.StopServer() MyKit.log.Add(" Stoped!") ToolStripStatusLabel8.Text = "Stopped" End Sub Private Sub ToolStripMenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem5.Click Me.Close() End Sub Private Sub NodesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NodesToolStripMenuItem.Click Systems.ShowDialog() End Sub End Class MyKit.vb Public Class MyKit Public Shared log As New ArrayList Public Shared Function GetConnectionString() As String 'Return "Data Source=BCAS;Initial Catalog=webproxy;Persist Security Info=True;User ID=sa; password=aqura" Return "Data Source=.SQLEXPRESS;AttachDbFilename=D:DotNet ProjectDeliverables03 projectWebBlockerwebproxy_Data.MDF;Integrated Security=True;User Instance=True" End Function End Class 33
  • 49. ProxyClient.vb Imports System Imports System.Collections Imports System.Data Imports System.Data.SqlClient Imports System.Diagnostics Imports System.Text Imports System.Threading Imports System.Net Imports System.Net.Sockets Imports System.IO Public Class ProxyClient Public ipaddress As String Public clref As TcpClient Public s As Socket Public cmd As New SqlCommand() Public cmd1 As New SqlCommand() Public con As SqlConnection Public ds As DataSet Public pcal As ArrayList Public reqstr As String Dim p1 As New SqlParameter() Dim p2 As New SqlParameter() Dim p3 As New SqlParameter() Sub send(ByVal msg As String) Dim b() As Byte b = System.Text.Encoding.ASCII.GetBytes(msg) s.Send(b) End Sub Sub send(ByVal b() As Byte) s.Send(b) End Sub Function recieve() As String On Error Resume Next Dim b(1024) As Byte Dim n As Integer n = s.Receive(b) Dim msg As String msg = System.Text.Encoding.ASCII.GetString(b, 0, n) Return msg End Function 34
  • 50. Sub InitInsertCacheParameters() p1.SqlDbType = SqldbType.VarChar p2.SqlDbType = SqlDbType.DateTime p3.SqlDbType = SqlDbType.Decimal p1.Size = 200 p3.Precision = 9 p3.Scale = 0 p1.ParameterName = "@url" p2.ParameterName = "@downloadtime" p3.ParameterName = "@ID" p3.Direction = ParameterDirection.Output cmd.Parameters.Add(p1) cmd.Parameters.Add(p2) cmd.Parameters.Add(p3) cmd.CommandType = CommandType.StoredProcedure 'Name of stored Procedure. cmd.CommandText = "INSERTCACHE" End Sub 'Method used for DownLoading a WebPage using WebClient Class. Function DownLoadPage() As Byte() Dim size As Integer = 0 'download the page(html) Dim wc As New WebClient Dim b() As Byte 'Dim rserver As Integer = 0 ' c => content MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::downloading from remote server......") MsgBox("Downloading from server", vbOKOnly) 'DownLoads data form Resource form specified URI(Universal Resource Identifier) b = wc.DownloadData(reqstr) MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::........done") MsgBox("Download completed", vbOKOnly) 'Releases all resources used by the System.ComponentModel.Component. wc.Dispose() size = b.Length 'insert into cache and retrieve new identity MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url inserted into cache ") 'download and save html content 'checks whether Directory is present or note If (Not Directory.Exists("c:wpscache")) Then Directory.CreateDirectory("c:wpscache") End If Dim origfilename As String = "c:wpscache" + "test.htm" Dim fs As New FileStream(origfilename, FileMode.Create, FileAccess.Write) 35
  • 51. Dim bw As New BinaryWriter(fs) bw.Write(b) fs.Close() MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::saved to cache......" + origfilename) MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::saved size into cachetable") Return b End Function Public Sub ProcessRequest() reqstr = recieve() MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::complete reqstr:" + reqstr) ' retrieving requrl from get (header) Dim i, j As Integer 'Getting data From GetHeader i = reqstr.IndexOf(" ") j = reqstr.IndexOf(" ", i + 1) reqstr = reqstr.Substring(i + 1, j - i - 1) MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url(reqstr) is " + reqstr) If (NodeCheck() = False) Then MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::Node is blocked") 'Standard way of sending a Webpage to a client Using HTTP Protocol. send("http/1.1 200 ok" & " " & vbCr & vbLf & vbCr & vbLf & "sorry! This current system has no access to internet!") s.Close() ElseIf (FirewallCheck() = False) Then MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is not allowed") 'Standard way of sending a Webpage to a client Using HTTP Protocol. send("http/1.1 200 ok" & " " & vbCr & vbLf & vbCr & vbLf & "sorry! u r denied access to " + reqstr) s.Close() Else MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::Node is not blocked") MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is allowed") Dim identity As Object = Nothing '= CacheCheck() If (identity Is Nothing) Then MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is not available in cache") 36
  • 52. Dim b() As Byte Try b = DownLoadPage() 'provides easy access to parts of URI Dim u As Uri = New Uri(reqstr) Dim c As String = "" If ( _ u.PathAndQuery = "/" Or _ u.PathAndQuery.ToLower().EndsWith(".htm") Or _ u.PathAndQuery.ToLower().EndsWith(".html")) Then c = System.Text.Encoding.ASCII.GetString(b, 0, b.Length) send(c) Else send(b) End If MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::downloaded content sent to client") s.Close() Catch exp As Exception s.Close() MyKit.log.Add(vbNewLine & "Error Message" + exp.Message) End Try Else MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url is available in cache") Dim fs As New FileStream("c:wpscache" + identity.ToString(), FileMode.Open, FileAccess.Read) Dim b(fs.Length) As Byte Dim br As New BinaryReader(fs) br.Read(b, 0, b.Length) br.Close() fs.Close() MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::url retreived from cache") Dim u As New Uri(reqstr) If ( _ u.PathAndQuery = "/" Or _ u.PathAndQuery.ToLower().EndsWith(".htm") Or _ u.PathAndQuery.ToLower().EndsWith(".html")) Then Dim content As String = System.Text.Encoding.ASCII.GetString(b, 0, b.Length) send(content) Else send(b) End If 37
  • 53. MyKit.log.Add(vbNewLine & Thread.CurrentThread.Name + "::cached content sent to client") 'for hits table s.Close() End If End If pcal.Remove(Me) End Sub 'used to verify whether the node is allowed or Not Function NodeCheck() As Boolean For Each r As DataRow In ds.Tables(1).Rows If (r(0).Equals(ipaddress)) Then Return Convert.ToBoolean(r(2)) End If Next Return False End Function 'used to verify whether the Requested URL is allowed or Not Function FirewallCheck() As Boolean For Each r As DataRow In ds.Tables(0).Rows MyKit.log.Add(vbNewLine & "Checking in... " & reqstr.ToLower() & " :: " & r("url").ToString().ToLower()) If (reqstr.ToLower().IndexOf(r("url").ToString().ToLower()) <> -1) Then Return False End If Next Return True End Function 'used to verify whether the Requested URL is present in cache or Not Function CacheCheck() As Object cmd1.CommandText = "select id from cachetable where url='" + reqstr.Trim() + "'" Return cmd1.ExecuteScalar() End Function End Class 38
  • 54. ProxyServer.vb Imports System Imports System.Collections Imports System.Data Imports System.Data.SqlClient Imports System.Diagnostics Imports System.Text Imports System.Threading Imports System.Net Imports System.Net.Sockets Imports System.IO Public Class ProxyServer Shared obj As New TcpListener(Dns.GetHostEntry(Dns.GetHostName()).AddressList(0), 50000) Shared pcal As New ArrayList() Shared MaxLimit As Integer = 20 Shared con As New SqlConnection() Shared ds As New DataSet() Shared da As SqlDataAdapter Shared count As Integer = 0 Shared toStop As Boolean Public Shared Function StopServer() As Boolean toStop = True While toStop MyKit.log.Add(vbNewLine & "Attempting To stop...") MsgBox("Attempting to stop", vbOKOnly) End While Return True End Function Public Shared Sub Start() InitializeProxyServer() toStop = False While (Not toStop) If (pcal.Count < MaxLimit) Then Dim pc As New ProxyClient() pcal.Add(pc) MyKit.log.Add(vbNewLine & "waiting for client...") MsgBox("Waiting for client", vbOKOnly) pc.s = obj.AcceptSocket() Dim tempidp As IPEndPoint = pc.s.RemoteEndPoint pc.ipaddress = tempidp.Address.ToString() 39
  • 55. pc.con = con pc.ds = ds pc.pcal = pcal MyKit.log.Add(vbNewLine & pc.ipaddress) MyKit.log.Add(vbNewLine & "...client connected") MsgBox("Client is connected", vbOKOnly) Dim th As New Thread(New System.Threading.ThreadStart(AddressOf pc.ProcessRequest)) count += 1 th.Name = "Request_" & count th.Start() End If End While toStop = False con.Close() End Sub Shared Sub InitializeProxyServer() Try obj.Start() MyKit.log.Add(vbNewLine & "web server started") con.ConnectionString = MyKit.GetConnectionString con.Open() da = New SqlDataAdapter("select * from urls", con) da.Fill(ds, "urls") da = New SqlDataAdapter("select * from systems", con) da.Fill(ds, "systems") MyKit.log.Add(vbNewLine & "copied firewall db into ds") Catch ex As Exception MyKit.log.Add(vbNewLine & ex.Message) End Try End Sub End Class SplashScreen.vb Public NotInheritable Class SplashScreen Private Sub SplashScreen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class 40
  • 56. Systems.vb Imports System.Windows.Forms Imports System.Net Imports System.Data Imports System.Data.SqlClient Public Class Systems Dim con As New SqlConnection Dim cmd As New SqlCommand Dim isLoading As Boolean Private Sub Systems_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = MyKit.GetConnectionString cmd.Connection = con ListView1.Items.Clear() isLoading = True con.Open() cmd.CommandText = "select * from systems" Dim dr As SqlDataReader dr = cmd.ExecuteReader While dr.Read Dim lv As New ListViewItem(dr.GetString(0)) lv.SubItems.Add(dr.GetString(1)) lv.Checked = dr.GetBoolean(2) ListView1.Items.Add(lv) End While con.Close() isLoading = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim lv As New ListViewItem(TextBox1.Text) lv.SubItems.Add(TextBox2.Text) lv.Checked = False ListView1.Items.Add(lv) con.Open() cmd.CommandText = "insert into systems(ipaddress,nodename) values('" & TextBox1.Text & "','" & TextBox2.Text & "')" cmd.ExecuteNonQuery() con.Close() End Sub 41
  • 57. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim l As ListViewItem = ListView1.SelectedItems(0) con.Open() cmd.CommandText = "delete from systems where ipaddress = '" & l.Text & "'" cmd.ExecuteNonQuery() con.Close() ListView1.Items.Remove(l) End Sub Private Sub ListView1_ItemChecked(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckedEventArgs) Handles ListView1.ItemChecked If isLoading Then Exit Sub End If Dim l As ListViewItem = e.Item con.Open() cmd.CommandText = "update systems set status=" & IIf(l.Checked, 1, 0) & " where ipaddress = '" & l.Text & "'" cmd.ExecuteNonQuery() con.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class URLForm.vb Imports System.Windows.Forms Imports System.Data Imports System.Data.SqlClient Public Class URLForm Dim con As New SqlConnection(MyKit.GetConnectionString) Dim cmd As New SqlCommand Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click 42
  • 58. Me.Close() End Sub Private Sub URLForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cmd.Connection = con cmd.CommandText = "select * from urls" con.Open() Dim dr As SqlDataReader = cmd.ExecuteReader While dr.Read ListBox1.Items.Add(dr.GetString(0)) End While con.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim s As String s = InputBox("Enter The URL ") ListBox1.Items.Add(s) cmd.CommandText = String.Format("insert into urls values('{0}')", s) con.Open() cmd.ExecuteNonQuery() con.Close() End Sub Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click Dim s As String s = ListBox1.SelectedItem If Not s Is Nothing Then ListBox1.Items.Remove(s) cmd.CommandText = String.Format("delete from urls where url = '{0}'", s) con.Open() cmd.ExecuteNonQuery() con.Close() End If End Sub End Class 43
  • 59. Databases Usedin our Project: We have used a database named MyWebProxyDB.MDF, which contains the following tables along with their attributes. 1. CacheTable- This will maintain id, url,download time and cache memory. 2. Slogin- Maintains sid, spwd of the administrator. 3. systems- Will contain IPaddress, node name and status of different clients. 4. url- This will maintain a list of urls that are blocked by the server. 44
  • 62. Adding the sites to be blocked by the server: Adding the Clients in the network: 46
  • 63. After adding the client to the server: During client accessing: 47
  • 65. Debug: When client tries to access a blocked site: 49
  • 67. 8.TESTING Software testing is a critical elementof software quality assurance and represents the ultimate view of the specification, design nad coding.In fact, testing is one step in the software engineering process that could be viewd as destructive rather than constructive. A stratergy for software testing integrates software test case design methods into a well- planned series of steps that result in the successful construction of software.Testing is the set of activities tht can be planned in advance and conducted systematically. The underlying motivation of program testingis to affirm softwarer qualitywith methods that can economically and effectively to both small and large-scale systems. STRATERGICAPPROACHTO SOFTWARE TESTING: The software engineering process can be viewed as spiral. Initially system engineering defines the role of softwareand leads to software requirement analysis where the information domain, functions, behavior, performance, constraints and validation criteria for software are established. Moving inward into the spiral, we come t design and finally to coding. To develop computer software we spiral I along steamlines that decrease the level of abstraction on each tun. A stratergy for software testing may also be viewed in context of the spiral. Unit testing begins at the vertex of the spiral. And concentrates on each unit of the software as implemented in the source code. Testing progress by moving outward along the spiral to integration testing, where the focus is on design and the concentration of software architecture. Taking an another turn outward on the spiral, we encounter validation testing where requirements established as part of software requirements analysis are validated against the software that has been constructed. Finally, we arrive at system testing, where the software and other system elements are tested as a whole. Test Case Generation involves in testing and every module of the software system by giving test data. Related test cases for the system are as follows. First, the different conditions that need to be tested along with the cases used for testing these conditions and expected outputs are given. Next, each module is containing the data fields used for testing are also given. The results and the actions to be performed after getting wrong or invalid results are the key aspects that are taken into considerations in this phase of testing. In the current project the test cases have been selected using the functional approach. The goal is to test the different requirements are specified in the requirements specifications document. Test cases have been selected for both valid and invalid inputs. 50
  • 68. 8.1 White Box Testing: In this type of testing, the changes in the operations are visible to the user. In our project tool, using this testing, it is verified that the client nodes are connected properly and also the there is proper manage of the URL’s. Hence, this test is successfully performed. 8.2 Black Box Testing: In this type of testing, there is no visibility to the internal changes that occur. In our tool, this test verifies whether the blocked sites are not accessed and the other sites are accessible by the client in request. Hence, this test is also successfully verified. The test cases prepared for testing the main modules of the current project are as follows:- TEST CASE 1: Test Aspect Checking whether a new website can be added to a firewall table or not. Action performed Type the domain name which you want to add to the firewall database Test Data www.facebook.com Expected Result When the corresponding add button is clicked the new web site should be added Actual Result A new web site is added if we look into the firewall data base Final Result SUCCESS Table 1.1 51
  • 70. TEST CASE 2: Test Aspect Checking whether an existing website can be removed from firewall table or not. Action performed Type the domain name which you want to remove from the firewall database Test Data www.google.com Expected Result When the corresponding delete button is clicked the existing web site should be deleted Actual Result A new web site is deleted if we look into the firewall data base Final Result SUCCESS Table 1.2 Test Screen 2: 53
  • 71. TEST CASE 3: Test Aspect Checking whether a new client can be added or removed Action performed Type the IP address of the respective client Test Data 192.168.254.66 Expected Result Should be added or removed accordingly Actual Result Successfully added or removed the client based on the instruction Final Result SUCCESS Table 1.3 Test Screen 3: 54
  • 72. TEST CASE 4: Test Aspect Checking whether a allowed webpage is being properly downloaded or not in the browser through our proxy server Action performed Type the domain name in the browser and request it to be displayed. Test Data www.gmail.com Expected Result The webpage should be displayed properly Actual Result The requested webpage has been displayed properly. Final Result Success Table 1.4 55
  • 74. TEST CASE 5: Test Aspect Checking whether restricted webpage is blocked or not Action performed Type the domain name which is not in cache Test Data www.google.com Expected Result Access should be denied Actual Result Requested web page is not displayed Final Result SUCCESS Table 1.5 57
  • 76. TEST CASE 6: Test Aspect Checking whether requested web page which is in cache , displays a message i.e. page from cache or not Action performed Type the domain name which is in cache Test Data www.yahoomail.com Expected Result Should display the message that the requested page is from cache Actual Result Requested web page is from cache is displayed Final Result SUCCESS Table 1.6 59
  • 78. TEST CASE 7: Test Aspect Checking whether requested web page which is not in cache , displays a message i.e. page from remote server Action performed Type the domain name which is not in cache Test Data www.orkut.com Expected Result Should display the message that the requested page is from server Actual Result Requested web page is from server is displayed Final Result SUCCESS Table 1.7 61
  • 81. 9. CONCLUSION With the increase in the number of clients in a network, there might be a problem of accessing unauthorized sites and sites which cause some problems, thereby increasing the complexity. Reliability has to be maintained as more clients are used. Web Blocker is a tool that can restrict the clients from accessing particular websites so that they can access internet from behind a firewall. This increases security and performance. With proper design and implementation, Web Blocker will be a very useful tool to provide caching service, maintaining log files and acts as a firewall. FUTURE SCOPE Generally, to control access to websites in an intra network, a network administrator is required continuously to monitor the services. By using the Web Blocker, even a lab in charge can handle it with minimum knowledge as we develop a user interface screen through which he can block and release. 63
  • 82. 10. REFERENCES 1. Object-Oriented Modeling and Design with UML by, Rumbaugh. 2. Object-Oriented Analysis and Design with Applications by, Booch. 3. Object-Oriented Software Engineering, Second Edition, by, Bernd Bruegge and Allen H.Dutoit. 64