From the server’s point of view a censored communication is indistinguishable from a communication that has never been initiated by the client. Similarly, from the customer’s point of view a censored website is indistinguishable from a website that does not exist/is out of order. The solution in both cases is to seek a back channel in which communication is successful, and use that channel to inform about the unavailability of the original communication. In the absence of such a channel, a maximum of infer that certain segment of its users/visitors is having some problem, monitoring for abrupt changes in its access pattern.
Note: the most guaranteed way to avoid partial censorship would be to use HTTPS - because that way all the content of the communication, including query strings, would be confidential between client and server. However there are cases where this is not possible (e.g.: China, which has banned the use of HTTPS as far as I know) or that this can be circumvented (e.g., an attack Mitm Institucional, where the censoring agent has power over the client code or its Cass).
In principle this could occur so far in Brazil, but the AC-Root of ICP-Brazil is not recognized by browsers by default (which is why everyone sees security alerts when accessing secure government websites). On the other hand, programs that make institutional Mitm by default - such as Opera Mini and Nokia’s "accelerator" - allow this to be done without "giving in to sight"...
Canais Alternativos
In the case of a partially censored application, one way would be to have an error code that identified the communication failure, but constructed in such a way that this code was communicated smoothly. That is, when sending http://example.com/foo?texto=palavra-censurada
and receive a timeout (or other error), the client code should immediately send a second request to http://example.com/bar?cod=251
where the code 251
would be the equivalent of "requisition foo
failed". From there, the server could use data mining techniques/clustering or similar to try to identify what failed customers have in common.
In the case of a fully blocked application, the only solution (for customers) is to try to use a proxy (for example, "down for Everyone or just for me?"). This will let them know if the server is down or if they’re the only ones who can’t access it. If the server itself can maintain such an unlocked proxy, then it would be feasible to maintain a browser extension that makes one ping this proxy whenever an attempt to access the main site fails (although the mere existence of this extension would draw the attention of those who censored the site, so that it would also censor the extension...).
Peer-to-peer
In the impossibility of designating a single server to act as an alternative channel (for example, because that server lives being blocked) a possibility would be to try to use communications peer-to-peer (P2P) so that users would exchange information with each other about the server’s state. In the browser, the default [proposed] Webrtc can be of great help when widely supported (currently is already in Firefox, Chrome and Opera).
However, Webrtc alone does not solve the problem of NAT Traversal - the ability of computers belonging to different subnets to communicate with each other. This problem can become nonexistent with the adoption of Ipv6, where there are sufficient addresses for every device imaginable without the need for subnets (or rather, there is a possibility they have a global IP although are part of a subnet), but while most systems still use Ipv4 NAT Traversal is still required.
The project serverless webrtc (Webrtc without a [signage] server), for example, eliminates the need for any server except for STUN (and there are several servers public for this purpose) - provided that the pairs to connect collaborate on a protocol of their own. I have not studied this protocol in depth, but I believe that it would be possible for the system to offer facilities for this to be done a posteriori (i.e. negotiate the connection proactively, use the connection if censorship occurs).
Unusual Access Patterns
In general, as in the web architecture are clients who always initiate a communication, there is no way to know for sure if a lock like this occurred. However, if your service has a reasonable number of registered visitors/users, you can apply data mining/clustering to assist in fault detection.
Let’s say several pre-existing customers stopped using the site simultaneously from the same date [approximately]. In a grouping, this would be a characteristic (dimension? metric? sorry, but I only have a superficial knowledge of DM) interesting that would bring together a set of users. If you have information about the geographic location of these users (or other type of information, such as IP addresses) - information that also groups users into clusters - then the system can do the correlation between one feature and another (i.e. place and date of last access).
This correlation would indicate a problem: be it censorship, as in the present discussion, or the fall of a link, as in the case of split network (see Reply by @Alexandre Marcondes). Auxiliary measures could then be taken to confirm or refute that a censorship is indeed in progress.
Censured Content
Finally, a brief note about the case where certain contents (say, keywords) are being censored, but the rest of the application is ok. It is very difficult for the client to communicate to the server what is being censored, since the attempt to "circumvent" censorship (via alternative channel, alternative coding, etc.) could itself also be censored. A widely used feature in situations where encryption is unavailable is steganography: a technique of security for obscurantism (security through obscurity) which consists in sending apparently innocuous messages but containing a second "hidden" message in it.
There are tools that enable steganography to an acceptable degree of confidentiality (requiring a password to access the secret part) and plausible deniability (the variations in the original message that hide the secret are indistinguishable from random variations, resistant to the most common statistical analysis techniques). Meanwhile, the distribution of these tools has to take place in a private character (otherwise the agent of censorship will also have access to them) - which makes it impracticable to use them in the context of web applications. In addition, their "performance" is well below the desired, since the message "visible" has to be orders of magnitude greater than the message "invisible".
Using a VPN solves this problem.
– user314
Po, some regions of Brazil have ISP that are confusing.. you don’t know if they’re blocking or if you’re rolling a man-in-the-Middle operation.. I ran into a problem where they were screwing with the requisitions.. I think it was for incompetence but in doubt, switching to https solved the dilemma!
– Eduardo Xavier