This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Java as Filtering Web Content

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

greetings everyone!

does anyone have ever do filtering the web content using java app?
I thought that this could be used, when we apply some socketserver into our localhost itself.
And with another socket to connect to the real web domain (address).

(take note: that our machine is connected to the internet line).

And...
The problem arose when the bytes received from the real web domain (address) translated from
inputstream... which makes the loading ... output appearance at our browser seems slow.

Does anyone may give me a bit clue to overcome this problem?

* NB: Sorry, i didnt mean to duplicate the thread (from Socket section).
 
Saloon Keeper
Posts: 8943
76
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might try Googling "proxy" for some ideas and source code.

The HTTP protocol has become complicated over the years in favor of higher throughput. I suspect that you're doing one of the following:
  • not making use of stay-open connections (i.e. re-connecting each time)

  • not handling "chunking" properly

  • waiting for all the bytes to arrive before outputting any filtered data to the client

  • you have a very inefficient filtering algorithm

  • you are not using threads for parallel processing of multiple streams.


 
J. Insi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, thanks for the respond, Carey Brown.
I did searching through Google. And I already did, get my app running.

when you said,

not making use of stay-open connections (i.e. re-connecting each time)
you are not using threads for parallel processing of multiple streams.


I'm using a Socket instances within a Thread class.

and,

you have a very inefficient filtering algorithm
waiting for all the bytes to arrive before outputting any filtered data to the client



That's rite, my algorithm is inefficient. Probably yes. That's why I need some evaluation.
but is it okay If I posted up the
source code I written here? (it's just 2 class(file) only).
 
J. Insi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hallo? is there anybody here....?
 
Rancher
Posts: 1337
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this was my problem, I'd start with an existing proxy solution -such as Muffin, but possibly a bit less dated- and would try to adapt it to my purposes.
 
J. Insi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lester Burnham wrote:If this was my problem, I'd start with an existing proxy solution -such as Muffin, but possibly a bit less dated- and would try to adapt it to my purposes.



ya, i guess so.
i think i should resolved this thread.

thanks guys!
reply
    Bookmark Topic Watch Topic
  • New Topic