Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DNS Filter

 
Song Guo
Greenhorn
Posts: 24
Chrome Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I need a program which I call it DNS filter program,and I have a file called FilterTable.txt(Attachments).The functions of the program are as follows.I open an Internet exporer,if I keyin "www.hit.edu.cn"(its ip is 219.217.227.180),the program will search FilterTable and access google'DNS 8.8.4.4 to parse the site.But if I keyin "www.baidu.com",the program will search TilterTable.txt and return "cannot access!".
How can I write the program using java? Vvvvvvvvvvvvvvery thank you!
FilterTable.png
FilterTable.txt
[Thumbnail for FilterTable.png]
 
Tim Moores
Bartender
Posts: 2686
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're talking about an HTTP proxy. Instead of wring it from scratch, why not use an existing one? There used to be one called "Muffin", although it's probably outdated now. But a web search will find others. Any particular reason it needs to be written in Java?
 
Song Guo
Greenhorn
Posts: 24
Chrome Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer.Its my homework that I will post it to my teacher.Muffin is comlex.I want to an very simple one.Could you help me?
 
Tim Moores
Bartender
Posts: 2686
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if it's homework then you should be doing it in the first place. What do you have so far, and where are you stuck making progress?
 
Paul Clapham
Sheriff
Pie
Posts: 20757
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said you were writing a program, but then you started talking about what Internet Explorer should do. I don't understand how those two things are related.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic