0% found this document useful (0 votes)
39 views53 pages

Proxy Server Overview and Analysis Report

Proxy

Uploaded by

Tejaswini Pawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views53 pages

Proxy Server Overview and Analysis Report

Proxy

Uploaded by

Tejaswini Pawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

“proxy Server”

A Project Report
On
Proxy server
Submitted by
Miss. Namrata Manohar Hage

Under the Guidance of


Prof. Dr. P. E. Ajmire

Toward the partial partial fulfilment of the degree of


Master Of Science (Computer Science )

Sant Gadge Baba Amravati University

Department of Computer Science and Application


G. S. Science, Arts and Commerce College, Khamgoan
District - Buldhana, Maharastra
2023 - 2024

MSc Final Year Page | 1


“proxy Server”

G. S. SCIENCE, ARTS & COMMERCE COLLEGE


KHAMGOAN

DEPARTMENT OF COMPUTER SCIENCE AND APPLICATION

CERTIFICATE
This is to certify that Miss. Namrata Manohar Hage studying in
M.Sc Part-II Semester IV (Computer Science ) has successfully
completed the project entitled “ proxy server ” and submitted the
related project report for the partial fulfillment of Master Degree in
Computer Science of Sant Gadge Baba Amravati University,
Amravati for the session 2023 - 2024

MSc Final Year Page | 2


“proxy Server”

Acknowledgement

The real spirit of achieving a goal is through the way of excellence and
lustrous discipline. I would have never succeeded in completing my task
without the cooperation, encouragement, and help provided to me by various
personalities.
I would like to take this opportunity to express my heartfelt thanks to our
principal Sir Dr. D. S. Talwankar .

I gratefully acknowledge the support extended by Head of the Department,


Dr. P. E. Ajmire and also thank him for letting us use the lab facilities.

I sincerely thank my guide Prof. Kirti. R. Shah. For her esteemed


guidance and encouragement, especially through difficult times. Her suggestion
broaden my vision and guided me to succeed in this work.

Finally I would like to express my thanks to all teaching and non-teaching


staff of the department and administrative office staff for their encouragement,
cooperation and help.

My greatest thanks are to all who wished me success especially my


parents, my friends who helped me directly or indirectly in completing this
project work.

I would like to express my appreciation for the wonderful experience


while completions of this project work.

MSc Final Year Page | 3


“proxy Server”

ABSTRACT

Every computer has an Ip address that identifies the device uniquely. Similarly,
the proxy server is a computer on the network that has its own IP address. But
not want to show our identity (IP address). In such a scenario, the proxy comes
into existence. We can achieve the same by using the proxy server. It provides
varying levels of functionality, security and privacy that depend on the use case,
needs or policies of the company. In this section, we will discuss what is a
proxy server, its type, advantages, need, and working of proxy servers.

The proxy server is a computer on the internet that accepts the incoming
requests from the client and forwards those requests to the destination server. It
works as a gateway between the end-user and the internet. It has its own IP
address. It separates the client system and web server from the global network.

In other words, we can says that the proxy server allows us to access any
websites with a different IP address. It play an intermediary role between user
and targeted websites or servers. It collects and provides information related to
user requests. The most important point about proxy server is that it does not
encrypt traffic.

MSc Final Year Page | 4


“proxy Server”

TABLE CONTENT

Overview of proxy server


Introduction 7
Types of proxy server ----------------------------------- 8
Issues of proxy server ----------------------------------- 9

ANALYSIS--------------------------------------------------------------11
User Requirement 12
Tools 13
Feature 14
System Requirement 15
System Requirement Specification ---------------------------- 16

Key features 16

Scope 17
Abreviation 18

Overall Description -------------------------- 19

Product Function -------------------------- 19


User Characteristics ----------------------- 20

General Constraints ----------------------------- 20


Functional Requirement --------------------------------------- 21

MSc Final Year Page | 5


“proxy Server”

Non Functional Requirement--------------------------------------------21


User Interface 22
GUI Listing 22
Programming listing 28

Conclusion 36

Reference 36

MSc Final Year Page | 6


“proxy Server”

Introduction

A Proxy server refers to server that acts as an intermediary between the


request made by clients, and a particular server for some services or requests for
some resources. The basic purpose of Proxy server is to protect the direct
connection of Internet client and Internet resources. Proxy server enable you to
connect private network or LAN to a public network such as the internet, by
acting a gateway for internal client computer to the internet proxy server is a
secure gateway which you can use to provide internet connectivity for IP and
IPX based network

Proxy server services should run on one computer to which both private
network and public network is connected to. The computer running proxy
server should have to interfaces:
 A network interface that point to public network.
 A network interface that point to the private network.

The proxy server also prevents the identification of the client’s IP


address when the client makes any request to any other servers. Proxy server
perform many tasks.

 There are two main purposes of proxy server:

 To keep the system behind it anonymous.


 To speed up access to a resource through caching .
Solution Domain
MSc Final Year Page | 7
“proxy Server”

“In computer networks, aproxy server is a server (a computer system or an


application program) that acts as an intermediary for requests from clients
seeking resources from other servers. A proxy is a stand-in for you- someone
who does something on your behalf.
As the name proxy, it means a server which fills up or acts and provides
functionalities of some other server. In an enterprise that uses the Internet, a
proxy server is a server that acts as an intermediary between a workstation user
and the Internet.”

TYPES OF PROXY SERVER

1. FTP Proxy Server:

Relays and caches FTP Traffic.

2. HTTP Proxy Server:

A one way request to retrieve Web Pages.

3. Socks Proxy Server:

A newer protocol to allow relaying of far more different types of data,whether


TCP or UDP.

4. NAT Proxy Server:


This one works a little different, it allows the redirection of all packets
without a Program having to support a Proxy Server.

5. SSL Proxy Server:


An extension was created to the HTTP Proxy Server which allows relayingof
TCP data similar to a Socks Proxy Server. This one done mainly toallow
encryption of Web Page requests.Furthermore, a Proxy Server can be split
into another two Categories:

6.Anonymous:

An Anonymous Proxy Server blocks the remote Computer from knowingthe


identity of the Computer using the Proxy Server to make

MSc Final Year Page | 8


“proxy Server”

7. Transparent:

A Transparent Proxy Server tells the remote Computer the IP Address of your
Computer. This provides no privacy.Anonymous Proxy Servers can further be
broken down into two more categories, Elite and Disguised. An Elite Proxy
Server is not identifiable to the remote computer as a Proxy in any way. A
Disguised Proxy Server gives the remote computer enough information to let it
know that it is a Proxy, however it still does not give away the IP of the
Computer it is relaying information for.

Issues of proxy server:


When proxy servers go down, the calls seem to come all at once. "Is there a
problem with the proxy server?" "I can't get to my Web site.""I keep getting this
message saying the computer can't find the server." Admittedly, many browsers
and proxy servers don't explain to users what went wrong with their request.
However, you can categorize nearly every proxy server problem into one of
four categories:

The browser or client is miss configured.

The URL or Web site is down.

Connectivity or network problems exist.

An actual proxy server problem exists.

Local Connectivity and Network Issues:


Network problems are common problems that every proxy server administrator
MSc Final Year Page | 9
“proxy Server”

faces. Even the proxy servers with the highest availability rates still have to
account for Web servers on the Internet that are down. If the remote site is down

MSc Final Year Page | 10


“proxy Server”

or inaccessible, it's often up to the administrator to break the bad news to end
users.You can quickly eliminate the proxy server from this picture by asking a
user to go to another Web site. Note that although the site appears, it might be
coming from the cache. To ensure that the proxy server is loading afresh copy
from the Web server, ask the user to hold down Ctrl+Shift and click Refresh (if
the client is using IE).One common problem during setup is the presence of
multiple default gateways. This problem generates a 10060 error (Connection
Timed Out)to any request sent to the Web Proxy service. Though this error is
often associated with slow external links to the Internet, if it occurs right after
setup, more than one default gateway is probably present.

Proxy server administrators often see event ID 120 in the proxy server's event
log. The event's description is The Proxy Service could not create a packet
filter. This message is typical on busy proxy servers with packet filtering
enabled. The purpose of the message is to alert the administrator that the packet
filter dropped more than 20 packets.

Possible issues with caching:


Caching right now Service URLs on your proxy server may result in the issues
below:1.

Users get time out errors when performing tasks.2.

Users get partial page loads.3.

Staff Users can open answers and incidents for editing, but when the session
times out or they leave the page, they can no longer get in.User must clear the
temporary Internet files in order to get in again.4.

Issues are intermittent and cannot be reproduced on demand.


Troubleshooting Tips
:
Caching issues with your browser may cause intermittent results as well.Try
clearing the cache in your browser. In Internet Explorer, use the stepsbelow:1.

Select Tools -> Internet Options2.

Under Temporary Internet Files, select Delete Files.3

MSc Final Year Page | 11


“proxy Server”

You may also change the browser to always request a new page. In Internet
Explorer, use the following steps:1.

Select Tools -> Internet Options2.

Under Temporary Internet Files, select Settings.3.

Under Check for new versions of stored pages, select Every visit tothe page.4.
Click OK.

ANALYSIS
3.1) SYSTEM STUDY
IDENTIFICATION OF NEED
In a LAN, it is needed that there should be some security provided by the administrator
and that some unauthorized sites should not be shown to that client in LAN. It was
needed to decrease the web page access time sothat those web pages that have been
accessed earlier should not be asked from the web directly.
FEASIBILITY STUDY
Following points are to be considered in feasibility study:
TECHNOLOGY
Mechanism for Client Server communication Browser Connection to server
Cache management

COST AND BENEFIT ANALYSIS


Building proxy server for LAN does not require any financial investment.Cost
is only in form of time and effort of the developer. Proxy servers areapplication
gateways originally created as part of firewall systems toimprove security.
Internal systems connect to the outside world throughthe proxy server, and
external systems respond to the proxy server. Theexternal systems do not see a
network of internal systems. They see onlyone system - the proxy server. Proxy
server reduces the response time forany request from the client.
REQUIREMENT SPECIFICATION
To develop a system according to the need of the end user and compatibleto the
most frequently used and easily available software and hardware, adetailed
requirement specification is needed to be performed. The variousrequirement
specifications are as follows:
MSc Final Year Page | 12
“proxy Server”

USER REQUIREMENT

1) A major requirement is to develop an application which reducesnetwork and


server load and provides increased client performance formost frequently used
web pages by caching.2) The application should act as a firewall between the
LAN and the Internet. The firewall has to make sure that it denies the requests
for any blocked site.3) It should block those clients in
LAN which are restricted for Internet access.4) It should have a user friendly
interface so that even a layman can use It
and understand it with ease.5) The software should be easily up gradeable in
which new modules and features can easily be added. It needs to be
specified that in case of a proxy server the user will be proxy server
administrator.

REQUIREMENT ANALYSIS
The firewall of proxy has to block the HTTP request emanating from aninvalid
IP address.

It also has to not to service the request for any link which is blocked by
the proxy administrator. The proxy has to have cacheto store the web
pages locally to reduce latency and network load. A userfriendly Graphical User
Interface also needed to be supplied for proxyadministrator.

5. TOOLS USED

5.1 AT FRONT END:


At front end we have used Core java (J2SE1.6)

Introduction to Java:
Java (with a capital J) is a high-level, third generation programming language,
like C, FORTRAN, Small talk, Perl, and many others. You can use Java to
write computer applications that crunch numbers, process words, play games,
store data or do any of the thousands of other things computer software can
do.Compared to other programming languages, Java is most similar to
C.However although Java shares much of C's syntax, it is not C. Knowing how
to program in C or, better yet, C++, will certainly help you to learn Java more
quickly, but you don't need to know C to learn Java. Unlike C++ Java is not a
super set of C. A Java compiler won't compile C code,and most large C
programs need to be changed substantially before they can become Java
programs.What's most special about Java in relation to other programming

MSc Final Year Page | 13


“proxy Server”

languages is that it lets you write special programs called applets that can be
downloaded from the Internet and played safely within a web browser

The Java Platform

A platform is the hardware or software environment in which a program runs.


We've already mentioned some of the most popular platforms like Microsoft
Windows, Linux, Solar is OS, and Mac OS. Most platforms can be described as
a combination of the operating system and under lying hardware. The Java
platform differs from most other platforms in that it's a software-only platform
that runs on top of other hardware-based platforms.

The Java platform has two components:

The Java Virtual Machine

The Java Application Programming Interface


(API)You've already been introduced to the Java Virtual Machine; it's the base
for the Java platform and is ported onto various hardware-based platforms.The
API is a large collection of ready-made software components that provide many
useful capabilities. It is grouped into libraries of related classes and interfaces;
these libraries are known as packages.

The next section,What Can Java Technology Do?highlights some


of the functionality provided by the API.The API and Java Virtual Machine
insulate the program from the underlying hardware.As a platform-independent

MSc Final Year Page | 14


“proxy Server”

environment, the Java platform can be a bits lower than native code. However,
advances in compiler and virtual machine technologies are bringing
performance close to that of native code without threatening portability.

Features of Java:

1. Platform independent:
The concept of Write-once-run-anywhere (known as the Platform
independent) is one of the important key feature of java language that makes
java as the most powerful language. Not even a single language is idle to this
feature
but java is closer to this feature. The programs written on one platform can
run on any platform provided the platform must have the JVM.

2. Simple:
There are various features that makes the java as a simple language.Programs
are easy to write and debug because java does not use the pointers explicitly. It
is much harder to write the java programs that can crash the system but we
cannot say about the other programming languages. Java provides the bug free
system due to the strong memory management. It also has the automatic
memory allocation and deallocation system.

3. Object Oriented:
To be an Object Oriented language, any language must follow at least thefour
characteristics.

1. Inheritance:
It is the process of creating the new classes and using the behavior of the
existing classes by extending them just to reuse the existing code and adding
MSc Final Year Page | 15
“proxy Server”

the additional features as needed.

MSc Final Year Page | 16


“proxy Server”

2. Encapsulation:
It is the mechanism of combining the information and providing the abstraction.

3. Polymorphism: As the name suggest one name multiple


form,Polymorphism is the way of providing the different functionality by
the functions having the same name based on the signatures of the

methods.

Dynamic binding:
Sometimes we don't have the knowledge of objects about their specific types
while writing our code. It is the way of providing the maximum functionality to
a program about the specific type at runtime.
As the languages like Objective C, C++ fulfills the above four characteristics
yet they are not fully object oriented languages because they are structured as
well as object oriented languages.
But in case of java, it is a fully Object Oriented language because object
is at the outermost level of data structure in java. No stand alone methods,
constants,and variables are there in java. Everything in java is object even the
primitive data types can also be converted into object by using the wrapper
class.

4. Robust:
Java has the strong memory allocation and automatic garbage collection
mechanism. It provides the powerful exception handling and type checking
mechanism as compare to other programming languages.Compiler checks
the program whether there any error and interpreter checks any run time
error and makes the system secure from crash. All of the above features
makes the java language robust.

5. Distributed:
The widely used protocols like HTTP and FTP are developed in java.Internet
programmers can call functions on these protocols and can get access the files
from any remote machine on the internet rather than writing codes on their local
system.

6. Portable:
The feature Write-once-run-anywhere makes the java language portable
provided that the system must have interpreter for the JVM. Java also has the

MSc Final Year Page | 17


“proxy Server”

standard data size irrespective of operating system or the processor.These


features make the java as a portable language.

7. Dynamic:
while executing the java program the user can get the required files dynamically
from a local drive or from a computer thousands of miles away from the user
just by connecting with the Internet.

8. Secure:

Java does not use memory pointers explicitly. All the programs in java are run
under an area known as the sand box. Security manager determines the
accessibility options of a class like reading and writing a file to the local

disk. Java uses the public key encryption system to allow the java applications
to transmit over the internet in the secure encrypted form. The byte code Verify
checks the classes after loading.

9. Performance:
Java uses native code usage, and lightweight process called threads. In the
beginning interpretation of byte code resulted the performance slow but the
advance version of JVM uses the adaptive and just in time compilation
technique that improves the performance.

10. Multi threaded:


As we all know several features of Java like Secure, Robust, Portable,dynamic
etc; you will be more delighted to know another feature of Java which is

Multithreaded.
Java is also a multithreaded programming language. Multithreading means a
single program having different threads executing independently at the same
time. Multiple threads execute instructions according to the program code in a
process or a program. Multithreading works the similar way as multiple
processes run on one computer.Multithreading programming is a
very interesting concept in Java. In multithreaded programs not even a single
thread disturbs the execution of other thread. Threads are obtained from the
pool of available ready to run threads and they run on the system CPUs.

11. Interpreted:
we all know that Java is an interpreted language as well. With an interpreted
language such as Java, programs run directly from the source code.The
MSc Final Year Page | 18
“proxy Server”

interpreter program reads the source code and translates it on the fly into
computations. Thus, Java as an interpreted language depends on an interpreter
program.The versatility of being platform independent makes Java to out shine
from other languages. The source code to be written and distributed is platform
independent.Another advantage of Java as an interpreted language is its error
debugging quality. Due to this any error occurring in the program get straced.
This is how it is different to work with Java.

5.2 AT BACK END:


We are using MySQL Database System. It documents MySQL up toVersion
5.0.9-beta, but is also applicable for older versions of the MySQLsoftware (such
as 3.23 or 4.0-production) because functional changes areindicated with
reference to a version number.

6. SYSTEM REQUIREMENTS:

Hardware Requirements

Processor : Pentium IV 2GHz or aboveRAM : 2GB RAM or aboveMonitor :


15” Color Monitor
KeyboardMouse
Software
Requirements
Operating System

:
Windows XP

Front End :

Language used : Java (Edition : J2SE)- Jdk : Java Development kit 1.6- Compil
er : javac- Interpreter : java- Debugger : jdb- Developing Tool/IDE : NetBeans I
DE 6.5

BackEnd :

Database System : MySQL5.0.9-beta

Other Requirements:
MSc Final Year Page | 19
“proxy Server”

Internet Connectivity.

9. SYSTEM REQUIREMENT SPECIFICATION

9.1 PURPOSE

A network is any collection of independent computers that communicate with


one another over a shared network medium. A computer network is a collection
of two or more connected computers.When these computers are joined in a
network, people can share files and peripherals such as modems, printers,
tape backup drives, or CD-ROM drives. When networks at multiple locations
are connected using services available from phone companies, people can send
e- mail, share links to the global Internet, or conduct video conferences in real
time with other remote users. As companies rely on applications like electronic
mail and database management for core business operations, computer
networking becomes increasingly more important.But, as said a coin has two
sides. Network has may disadvantages with security and speed being the
primary concerns. Using a proxy server can reduce many problems. Now let us
see what proxy server is.A proxy server is a computer that offers a computer
network service to allow clients to make indirect network connections to other
network services. A client connects to the proxy server, then requests a
connection,file, or other resource available on a different server. The proxy
provides the resource either by connecting to the specified server or by serving
it from a cache. In some cases, the proxy may alter the client's request or the
server's response for various purposes.

HTTP Proxy Server:

Middlemen" between clients and servers

Proxies which process http and (not always) ftp requests areknown as http proxy
servers

MSc Final Year Page | 20


“proxy Server”

Key features of HTTP Proxy servers:

It Provides Anonymity and Security.

It is a Caching Proxy server.

Serves as content filter.

Multithreading.

SCOPE

We designed and implemented a caching proxy server that handles HTTP


traffic. It can be included into many programs: browsers,download managers
etc. However, its support is not realized at a level of an operating system

in order to use it, you should configure all programs, which should use proxies,
in an appropriate way. It can carry out caching of information downloaded from
the Internet.

The application is implemented in Java, and as such it benefits from cross-


platform portability.

9.3 DEFINITION, ACRONYMS & ABREVIATIONS

J DesktopPane:
A container used to create a multiple-document interface or a virtual desktop.
You create J Internal Frame objects and add them to the J DesktopPane.

MSc Final Year Page | 21


“proxy Server”

Virtual desktop:
-Virtual desktop can be created using J Desktop Pane and J Internal Frame.-J
Desktop Pane works as parent and J Internal Frame works as child.

J Panel:
It acts as a cover to the container. Reusability highly increases if we use Panel
as a base.

Card Layout:
- Multiple cards( JPanel) can be added to Card Layout.- Each card added to
the Card Layout should be JPanel or its derived class- Only one card is visible
at a time.-Navigation options like first,next,previous and last can be added.-
Card Layout is used to create wizards.

J Window:
-It is very similar to J Frame but it does not have min ,max or close buttons.-It
does not have borders,title bar a menubar. It is used to create Splash Screen

J Internal Frame :
A lightweight object that provides many of the features of a native frame,
including dragging, closing, becoming an icon, resizing, title display, and
support for a menu bar

9.4 OVERALL DESCRIPTION

PRODUCT PERSPECTIVE

Our project is designed to implement the basic functionalities of a proxy server.


Though our product i.e. proxy server may not address all the functions, it
simply provides a clear picture of how a proxy is working.This project stresses
on caching. Caching has a lot of benefits. Caching is analogous to the
mechanism used by a cache memory in memory hierarchy. When we talk of
cache memory, it stores all the instructions which may be immediately needed
MSc Final Year Page | 22
“proxy Server”

by the processor.

MSc Final Year Page | 23


“proxy Server”

Hence, the processor first searches the instruction in the cache memory. It
helps in improving the speed. Caching, in proxy server is similar to the above
mechanism.

PRODUCT FUNCTIONS

The project performs the following functions:a)

It acts as an intermediary between a network and a client. This


feature is very important for security purpose. It hides the client‟s IP
address in the vast network. Hence, the system becomes secure.b)

It performs the caching of websites. If the requested URL is stored in the


cache, then the response is delivered via cache otherwise from the main
server.c)

It performs the basic URL blocking. But, it is not capable of performing this
functionality selectively. It blocks the URL for all clients using the proxy.

USER CHARACTERISTICS

SOFTWARE DEVELOPERS: The developers are expected to have athorough


knowledge of:
a) The language in which the application is to be designed.

b) Concepts of computer networking.

c) Network programming in java.

d) Data flow in the system CLIENTS:


Clients just need to be able to use the product

9.5 GENERAL CONSTRAINTS


The functionalities which our project does not provide are:

1) It does not provide efficient caching.

2) It is not able to perform selective client blocking.


MSc Final Year Page | 24
“proxy Server”

3) It cannot track the Internet usage for each user.

4) It does not provide specific packet filtering through ports

9.6 FUNCTIONAL REQUIREMENTS

The functional requirements of this project include(1) GET, HEAD commands.


The GET is the mostly used command in
HTTP, carrying out the actual fetching of the content. Your program will need
to parse a command line like, GEThttp://www.test.com/test.htmlHTTP/1.1,from
clients and then make a TCP connection to the target web server to get the
requested page. The HEAD is similar to the GET except that only meta
information, rather than a complete message-body (ex: the page), is returned.

Support of the If-Modified-Since conditional request. This header field in an


HTTP request is typically used to examine whether the content stored in the
proxy server is still valid. If not, the server fetches again the content from
the origin site, forwards it to the client, and replaces the existing expired
one.

9.7 NON FUNCTIONAL

REQUIREMENTS EXECUTION

QUALITIES:

1) This project performs the caching of web sites which improves the speed .
2) This project performs the basic URL blocking procedure.
3) It act as an intermediary between a network and a client.

MSc Final Year Page | 25


“proxy Server”

EVOLUTION QUALITIES:

MSc Final Year Page | 26


“proxy Server”

This project has been designed with the help of Net Beans hence it is scalable
and flexible. It can easily handle all future changes like addition of extra
functionality. It is also easy to maintain, with all the source code and class file
in one folder implicitly. this is in contrast to notepad programming, where we
have to explicitly store all source code.

9.8 USER INTERFACE


Our project uses virtual desktop concept in java.

What is a virtual desktop?


Virtual desktop can be created using JDesktopPane and JInternalFrame.J
DesktopPane works as parent and JInternalFrame works as child.Steps to create
Virtual Desktop:

1) Create JFrame
2) Create JDesktopPane and add it to JFrame.
3) Create multiple instances of JIntaernalFrame and add it toJDesktopPane.
4) Each JInternalFrame can be covered by a separate JPanel.The
benefits of desktop virtualizationinclude:

Cost savings because resources can be shared and allocated on an as-needed


basis.

More efficient use of resources and energy.

Improved data integrity because backup is centralized.

Centralized administration.

Fewer compatibility issues.

MSc Final Year Page | 27


“proxy Server”

GUI Listing:

SplashPanel1.java
It opens a splash screen which displays the name of the project. A splash screen
is animagethat appears while a game or program is loading. It mayalso be used
to describe an introduction page on a website.

Splash screen sometimes do not cover the entirescreen,but only


arectanglenear the center. The splash screens of operating systemsand some
applications that expect to be run full-screen usually cover the entire screen.

VirtualDesktop.java
It opens a virtual desktop including a log-in page which allow only
authenticated user to have access to the server. If user name and password is
wrong, it shows an error message otherwise it opens a settings form.And it
also includes settings for changing username and password

JPanel3.java
It opens up a form which allows to change the username

JPanel4.java
It opens up a form which allows to change the password

MSc Final Year Page | 28


“proxy Server”

JPanel5.java
It consists of following elements:

List: It displays the sites to be blocked

Text Field: user can enter a site of his own choice to be blocked.

Add Button: this adds the site given by the user to the list.

Remove Button: user can select one or more sites in the list andclicking on this
button removes the selected sites from the list.

Continue Button: this is a confirmation button. After clicking thisbutton, List,


Add and Remove button gets disabled. After this usercannot enter any sites.

Finish Button: Starts the Main class.java (processing of software).

MSc Final Year Page | 29


“proxy Server”

MSc Final Year Page | 30


“proxy Server”

MSc Final Year Page | 31


“proxy Server”

10. PROGRAM LISTING

Our project comprises of five classes.


They are:
1) MainClass.java
2) Talker.java
3) ProxyURLConnection.java
4) SiteBlocker.java
5) URLCache.java

DESCRIPTION OF THE MODULES:

MainClass.java
The project is run through this class. Server Socket, Socket andSERVER_PORT
are initialized. Connection is established throughserverSocket.accept(). It
also starts the Talker thread.
Talker.java
This class listens to the multiple clients connecting to the server. It takes
the input from the browser‟s address bar
through BufferedReader andprints the request and various headers associated
with the request. It alsochecks to see if the request contains the URL which we
intend to block. If it contains the blocked URL, it calls the method siteBlocker()
from the

SiteBlocker class otherwise it calls method getConnection() from


theProxyURLConnection class.

MSc Final Year Page | 32


“proxy Server”

ProxyURLConnection.java
This class creates the constructor of URL class. It fetches the dataassociated
with the URL given in the address bar. It calls the get() method
from the URLCache class with parameters as url and browser‟s
output stream.

SiteBlocker.java
This class contains the method site Blocker() which gives the desiredaction to
take if the clients request for a blocked site.

URLCache.java
This class defines a simple caching mechanism used by the proxy server.If it
happens that the remote server/web server from where you are requesting any
data has filtered out your IP Address in that scenario you cannot access that
particular data but if you had accessed that data before through a proxy then
there are chances that the proxy server must have stored that data in it which is
called cache, it can be accessed now if you connect through the proxy
server.Our project does not effectively implement caching. It uses a Hash Map
to store pairs of URL and content accessed by the clients. After every request
made, this class first checks if the URL is present in the Hash Map, if it is then
it delivers the response from the cache. If not then, it delivers there response
server.

MSc Final Year Page | 33


“proxy Server”

11. CODING

1. Main Class.java
package my proxy;

import java.net.Server
Socket; import
java.net.Socket; import
java.util.Set;
public class Main Class
{public void start Main()
{Server Socket server Socket = null;
Socket socket = null;
final int SERVER_PORT = 9867;try
{server Socket = new Server Socket(SERVER_PORT);while (true)
{socket=
serverSocket.accept(); Talker
tk = new Talker(socket);
tk.start();
}

}
catch (Exception e1)
{e1.print StackTrace();

MSc Final Year Page | 34


“proxy Server”

MSc Final Year Page | 35


“proxy Server”

}
}

1. Talker.java

package my proxy;
import java.io.BufferedReader;
import java.io.Input Stream Reader;
import java.io.Print Writer;
import java.net.Socket;
public class Talker extends Thread
{ Buffered Reader input = null;
Print Writer output = null;
String b Sites;
public Talker() {
}public Talker(Socket socket, String str3)
{ try {

input = new Buffered Reader(new Input Stream Reader(socket.get Input


Stream()));
output = new Print Writer(socket.get Output Stream(), true);
b Sites = str3;
} catch (Exception e1)
{ e1.print Stack Trace();
}
}
@Over ride
public void run() {
String file = new
String();
Proxy URL ClassConnection p = new Proxy URLClassConnection();

MSc Final Year Page | 36


“proxy Server”

while (true) {try

MSc Final Year Page | 37


“proxy Server”

{String str = input.read Line();


if (str.indexOf("GET") != -1) {
file = new String();
int x = str.indexOf(" ");
int y = str.lastIndexOf(" ");
file = str.substring(x + 1,y;
}
System.out.println(str);
System.out.println("FILE : " + file);

int x1 = file.indexOf(".");
int y1 = file.lastIndexOf(".");
String site = file.substring(x1 + 1, y1);
if (bSites.indexOf(site) != -1) {
SiteBlocker.siteBlocker(output);
} else {
p.getConnection(file, output);
}
} catch (Exception e2) {
e2.printStackTrace();
System.out.println("Problem with Talker");
}
output.close();

}
}
}

MSc Final Year Page | 38


“proxy Server”

2. SiteBlocker.java

package myproxy;
import java.io.PrintWriter;
public class SiteBlocker {
public static void siteBlocker( PrintWriter output,String file){
{
output.checkError();
output.write("Cannot Display........");
}

output.close();
}
}

4. ProxyURLClassConnection.java
package
myproxy;
importjava.io.*;
import java.io.InputStream;
import
java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;import java.net.URLConnection;
import java.io.PrintWriter;
public class ProxyURLClassConnection {
public void getConnection(String s,PrintWriter output)throws
MalformedURLException, IOException {

URL url = new URL(s);

URLConnection urlConnection = url.openConnection();


InputStream input = urlConnection.getInputStream();

MSc Final Year Page | 39


“proxy Server”

URLCache u=new URLCache();


u.get(url,output);

MSc Final Year Page | 40


“proxy Server”

}output.close();
input.close();
}
}

5. Splash1.java
import javax.swing.*;
import java.awt.*;
public class Splash1
{
public static void main(String[] args){
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width-400)/2;
int y = (screen.height-300)/2;JWindow win = new JWindow();
SplashPanel1 s = new SplashPanel1();
win.setContentPane(s);
win.setBounds(x,y,400,300);
win.setVisible(true);
try {
for(int i=1;i<=100;i++)
{ Thread.sleep(60);
s.abc(i);
}
} catch(Exception e) {}
win.setVisible(false);
VirtualDesktop m= new VirtualDesktop();
m.setBounds(0,0,screen.width,screen.height);
m.setVisible(true);
}
}
MSc Final Year Page | 41
“proxy Server”

6. SplashPanel1.java
public class SplashPanel1 extends javax.swing.JPanel {
public SplashPanel1() {
initComponents();
}
public void abc(int a) {
jProgressBar1.setValue(a);
}
private void initComponents() {
jProgressBar1 = new javax.swing.JProgressBar();
jLabel1 =new javax.swing.JLabel();
setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.
BevelBorder.RAISED, null, new java.awt.Color(255, 153, 0), null,null));

setLayout(new java.awt.BorderLayout());
jProgressBar1.setBackground(new java.awt.Color(255, 153, 0));
jProgressBar1.setForeground(new java.awt.Color(255, 255, 255));

add(jProgressBar1, java.awt.BorderLayout.PAGE_END);
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/myproxy.jpg"))
);
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
add(jLabel1, java.awt.BorderLayout.CENTER);
}
private javax.swing.JLabel jLabel1;private javax.swing.JProgressBar
jProgressBar1;

MSc Final Year Page | 42


“proxy Server”

12. OUTPUT:
Output is retrieved by following steps:1.

Run Splash1, which causes SplashPanel1 to run.2.

We enter the login id and password.3.

It directs us to another page which asks for the sites to beblocked.4.

We click on next. It takes to confirmation page where we click on finish which


starts proxy server.

13. LIMITATIONS

One of the limitations is that you may have some issues with speed. Caching
becomes a bit slower in case of opening of subsequent pages.

It is not being able to retrieve complex images.

Conclusion

Thanks to standard proxy support in the clients, and the wide availability of
the cern_httpd proxy server, anyone behind a firewall can now have full Web

MSc Final Year Page | 43


“proxy Server”

access through the firewall host with minimum effort and without compromising
security. Corporate users don't have to be denied access to the Web any longer.

Considering the extremely fast growth of the Web, its ability to replace FTP, and
the fact that by the time this paper is published the Web usage has already passed
Gopher usage metered by the packet statistics in the network, the use of caching
proxy servers becomes essential to allow the growth to continue in case the total
Internet capacity doesn't keep up with the Web growth rate. The proxy caching
makes it possible to gain "virtual bandwidth" as documents often get returned from
a nearby cache rather than from some far away server.

References

https://www.geeksforgeeks.org/what-is-proxy-server/

Top 23 proxy-server Open-Source Projects (Apr 2024) (libhunt.com)

How to build a node.js proxy server ? - GeeksforGeeks

Project Report On Proxy Server | PDF | Proxy Server | Web Server


(scribd.com)

What is a Proxy Server? Definition, Uses & More | Fortinet

GitHub - siddharthjadhav7/Multithreaded-Proxy-Server-: A Java based


application that creates a multi-threaded web proxy server that is capable
of processing multiple simultaneous service requests in parallel. It

MSc Final Year Page | 44


“proxy Server”

enables caching and supports only GET method and handles errors whenever a
client requests an object that is not available.

MSc Final Year Page | 45


“proxy Server”

MSc Final Year Page | 46


“proxy Server”

MSc Final Year Page | 47


“proxy Server”

MSc Final Year Page | 48


“proxy Server”

MSc Final Year Page | 49


“proxy Server”

MSc Final Year Page | 50


“proxy Server”

MSc Final Year Page | 51


“proxy Server”

INDEX
Sr. No. Name of Topics Page No.

1. INTRODUCTION

1.1 Background 1
1.2 Objectives
1.3 Purpose, Scope, and Proposed system 2
1.3.1 Purpose
1.3.2 Scope
1.3.3 Proposed system

2. REQUIREMENTS AND ANALYSIS

2.1 Problem Definition 3


2.2 Requirements Specification
2.3 Planning and Scheduling
2.4 Software and Hardware Requirements
4
2.5 Feasibility study
2.5.1 Economic
2.5.2 Technical
2.5.3 Operational
3. SURVEY OF TECHNOLOGIES 13

4. SYSTEM DESIGN
18
4.1 Program Flowchart
19
4.2 UML Diagram
20
4.2.1 Use Case Diagram

5. IMPLEMENTATION AND TESTING

5.1 Coding Details 21


5.2 Testing Approach 27
5.2.1 Unit Testing
5.2.2 Integrated Testing
5.2.3 System Testing
5.3 Implementation

6. CONCLUSIONS 28

6.1 Limitations of the System


6.2 Future Scope of the Project
6.3 Conclusion
7. REFERENCES 29

MSc Final Year Page | 52


“proxy Server”

MSc Final Year Page | 53

You might also like