How to add html in response to a site before it reaches a Java browser?

I recently used a Mac application called Spotflux. I think this is written in Java (because if you hover over its icon, it literally says "java" ...).

It is just a VPN application. However, in order to support himself, he may show you ads ... while watching. You can view the chrome, and the page will load the banner below.

Since this is a VPN application, it obviously can control what comes in and out of your machine, so I assume that it simply adds some html to any response to the website before transferring it to your browser.

I am not interested in creating a VPN or something like that. The real question is: how, using Java, can you intercept the html response from a website and add more html to it before it reaches your browser? Suppose I want to make an application that literally places a snapshot at the bottom of every site you visit.

+4
source share
2 answers

This, of course, is a hypothetical answer - I really don't know how Spotflux works.

However, I assume that as part of his VPN, he installs a proxy server. Proxies intercept HTTP requests and responses for various reasons: most corporate networks use proxies to cache, monitor Internet usage and block access to NSFW content.

- HTTP- , HTTP; - HTTP-, ; HTML .

- Java.

+3

. , - HTTP -, RabbIT ( java). -, .

. . FAQ.

: , . , , HTML- . , CSS, javascript .. , HTML , .

+1

Source: https://habr.com/ru/post/1536462/


All Articles