+var handle_viewer_override = function(request, u, response) {
+ // Only accept requests from localhost.
+ var peer = request.socket.localAddress;
+ if ((peer != '127.0.0.1' && peer != '::1') || request.headers['x-forwarded-for']) {
+ console.log("Refusing viewer override from " + peer);
+ send_404(response);
+ } else {
+ viewer_count_override = (u.query)['num'];
+ response.writeHead(200, {
+ 'Content-Type': 'text/plain',
+ });
+ response.write('OK.');
+ response.end();
+ }
+}