K
K
Kirill Vasiliev2013-10-05 23:41:07
Squid
Kirill Vasiliev, 2013-10-05 23:41:07

Changing the html code passing through the proxy server

Greetings Khabrovites.
I need to change the html code for all http traffic, namely. Paste JavaScript link.
What is it for? There is a hotel and there is Wifi in it, I need to display a type of menu so that I can order the service.
How I see it
Wifi Client <-> Access point <-> Router <-> (redirect to transparent proxy with code replacement) -> Internet.
There is no question about the quality of layout and adaptation to different devices, as there are programmers who will deal with this. I'm wondering how you can change the html code?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
Kirill Vasiliev, 2013-12-17
@vasilevkirill

Solution found by privoxy

P
Pavel Zagrebelin, 2013-10-06
@Zagrebelion

And it would be nice if the entire Internet switched to https in general, so that such perversions would die a natural death.
Today you want to cram a menu with your services, tomorrow you want to replace all advertising banners / adwords with your partners, the day after tomorrow you will edit the Yandex output for a query, for example, “prostitutes near hotel N”, “restaurant in district N”, or whatever you need in hotel.
I'm not saying that if some page loads part of the content from the server via ajax, then your insertion can easily break the behavior of the site.

N
Nikita Gusakov, 2013-10-06
@hell0w0rd

Excuse me, but what is the difficulty? Recognize that this is html, or what?
We look at the content type, and then with any html parser we shove our script to the end of the body
It can be even easier ... before inserting your script and that's it

K
Kirill Vasiliev, 2013-10-06
@vasilevkirill

a person visits any site as an example /http://habrahabr.ru/ and is added to the end of all pages in
squid, I did not find such parameters, but squid only works with headers.
if you use nginx, then there is an opportunity, but please poke your nose

E
Ethril, 2013-10-06
@Ethril

Reminds me of a joke that was in circulation when the Proxomitron was still popular. User Internet traffic was wrapped on it, and it was configured so that with a probability of 1%, the Russian indefinite article “fuck” was substituted after the commas ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question