Add a banner at the top on unknown HTML page on the fly; Send a note to network user

Posted by Vi on Stack Overflow See other posts from Stack Overflow or by Vi
Published on 2010-04-24T20:05:35Z Indexed on 2010/04/24 20:13 UTC
Read the original article Hit count: 147

Filed under:
|
|

I want to be able to send messages to users of network that my computer routes to.

Modifying requested pages, by adding messages like

Warning: this access point is going down soon"

or

Network quota exhausted

or

You are overusing the network connection and may be banned

or

Security notice: this is unencrypted network, so everybody around can see this page too

It seems the only good solution (as there is no general "Send notice to users of my access point" thing). All traffic is already routed through -j REDIRECT, socat and remote SOCSK5 server, so intercepting unencrypted content should be easy.

  1. How it's better to add a message? Just inserting <div style="color:white; background-color:red">Sorry, connect_me access point is going down soon...</div> as the first element of <body> breaks design of some pages (f.e. Wikipedia).

  2. Should I also add some "Cache-control" directive to prevent persisting such messages?

/* smdclient messages are poor solution, as them are Windows-only and can disturb users not using the network */

© Stack Overflow or respective owner

Related posts about html

Related posts about networking