Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2008, 03:28 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
[SOLVED] Site Blocking
Hello Sir

i have Http proxy server code,which is runing good.All "HTTP" open under the proxy server.But I want to block some site.I don't know technique of blocking.Plz give me example link or code or tips...

Plz help me

Thxs in Advance..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-06-2008, 07:04 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Plz help me for solve the problme
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-11-2008, 12:08 AM
Member
 
Join Date: Jul 2007
Posts: 14
vglass is on a distinguished road
Normally to block a site you just need to know the URL to block, typically the hostname. Using java.net.URL class you can check the domain used for a URL.

e.g.

URL url = new URL(address);
String host = url.getHost();
if(host.equals(blockedDoman) {
// perform deny code here
}
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-11-2008, 04:38 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,036
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Mir, as I said one of the earlier thread, first you should have the list of sites which you want to block. Then implement a access denied method on such.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 06-11-2008, 10:05 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Eranga View Post
Mir, as I said one of the earlier thread, first you should have the list of sites which you want to block. Then implement a access denied method on such.
Thxs for help me
Now I am abel to block the site from list. But problem is that i want to do this action through menuitem...

So how can i do this
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 06-11-2008, 10:07 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,036
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Add a menu item on your GUI menu. After that add an action listener to that menu item and call your method there.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 06-11-2008, 10:16 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Eranga View Post
Add a menu item on your GUI menu. After that add an action listener to that menu item and call your method there.
I add GUI menu...ok i am sending you menu code..

Code:
if (evt.target instanceof Button) { if(evt.target == button) { hide(); dispose(); return true; } else if(evt.target == site) { ArrayList <String> asq; px= new Proxy(""); asq=px.GetSite(); String a3=px.geUrlStr(); String un; for(int j=0;j<asq.size();j++) { un=asq.get(j); if(a3.contains(un)) { JOptionPane.showMessageDialog(null," In"); } else { JOptionPane.showMessageDialog(null," out"); } }
this is not working but same code is here which is working proxy class
Code:
for(int j=0;j<ArTemp.size();j++) { nu=ArTemp.get(j); if(un.contains(nu)) { JOptionPane.showMessageDialog(null," In"); return; // Here is difference } else { JOptionPane.showMessageDialog(null,"out"); } }

In This code i mark "return" which is blocking site to go next part. In the menuitem code "return " is not working..


Plz help me....
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 06-11-2008, 10:42 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,036
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
In simple word what you have to do is, make a list with blocking URL. Every time a user entered a URL compared it with the list. If you found such a thing in the list, block the whole process.

I can't see in your code have tried such a thing.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Close on September 4, 2008)

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 06-11-2008, 10:49 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Eranga View Post
In simple word what you have to do is, make a list with blocking URL. Every time a user entered a URL compared it with the list. If you found such a thing in the list, block the whole process.

I can't see in your code have tried such a thing.


Sir ,not blocking whole process.It is blocking only those url which is found in list.
Yes is compared each time with new url and list of url.

Plz help me
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 06-11-2008, 11:16 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Eranga View Post
In simple word what you have to do is, make a list with blocking URL. Every time a user entered a URL compared it with the list. If you found such a thing in the list, block the whole process.

I can't see in your code have tried such a thing.
Plz help me sir.....plz
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 06-23-2008, 07:56 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Mir View Post
Plz help me sir.....plz
Thxs for help....
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 07-02-2008, 06:59 PM
Member
 
Join Date: Jun 2008
Posts: 7
h3ckf1r3 is on a distinguished road
dude reposting a milion times wont help you. you have to search on google. read other threads and see if they help. Also a really good program will take things and put them together to make what you want happen
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 07-03-2008, 07:04 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by h3ckf1r3 View Post
dude reposting a milion times wont help you. you have to search on google. read other threads and see if they help. Also a really good program will take things and put them together to make what you want happen
ok h3ckf1r3

i got your point.....
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to connect to a web site suji Networking 1 02-15-2008 05:05 PM
Site hacked tim Suggestions & Feedback 3 02-02-2008 10:47 AM
How can I get a RealMedia file from a web site? emesol0 Networking 0 01-24-2008 08:01 PM
Printing all IP address of a site Java Tip Java Tips 0 11-24-2007 08:38 PM
Non Blocking Network mathias Networking 1 08-07-2007 07:49 AM


All times are GMT +3. The time now is 10:46 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org