buettner / private-prefetch-proxy

Proposal to use a CONNECT proxy to obfuscate the user IP address for privacy-enhanced prefetching.
32 stars 6 forks source link

Example traffic-advice file content for Google #21

Closed szepeviktor closed 3 years ago

szepeviktor commented 3 years ago
74.125.208.13 - - [18/Jun/2021:23:29:09 +0000] "GET /.well-known/traffic-advice HTTP/1.1" 404 5596 "-" "Chrome Privacy Preserving Prefetch Proxy"

I already receive requests for this file. @jeremyroman Could you provide some simple examples for Google/bot?

jeremyroman commented 3 years ago

If you're okay with the default behavior, you don't need to do anything. Returning 404 is perfectly valid.

You can provide this file (with the MIME type application/trafficadvice+json) if you wish to modify it. For example, if you wanted to expressly allow traffic from any prefetch proxy, you could write:

[{"user_agent": "prefetch-proxy", "disallow": false}]

This traffic is related not to Googlebot (the crawler), but determining whether user prefetch traffic from search results should be allowed.

szepeviktor commented 3 years ago

Thank you.

For Apache

RewriteRule "^/\.well-known/traffic-advice$" - [T=application/trafficadvice+json,END]
jasomdotnet commented 2 years ago

This example allow "Chrome Privacy Preserving Prefetch Proxy" to Prefetch without limitations:

[{
  "user_agent": "prefetch-proxy",
  "google_prefetch_proxy_eap": {
    "fraction": 1.0
  }
}]

Thanks @szepeviktor for Apache config, I used it in my article. This code (ehm, my own work) represents config for right MIME type on Nginx:

# Chrome Privacy Preserving Prefetch Proxy
location /.well-known/traffic-advice {
   types { } default_type "application/trafficadvice+json; charset=utf-8";
}