You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: paper.md
+37-5Lines changed: 37 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ tags:
7
7
- Measurement
8
8
- Analytics
9
9
- Referrer
10
+
- Reproducibility
10
11
authors:
11
12
- name: "Sam (Abbas) Farahmand Pashaki"
12
13
orcid: "0009-0006-7721-2644"
@@ -20,9 +21,9 @@ bibliography: paper.bib
20
21
21
22
# Summary
22
23
23
-
Browser referrer behavior is central to analytics, experimentation, and attribution pipelines, but it is difficult to reproduce locally. Browsers often suppress `Referer`/`document.referrer` in common local setups (non‑HTTPS origins, external 302 navigations, or OS/browser trust gaps), which prevents meaningful pre‑deployment validation.
24
+
Browser referrer behavior is central to analytics, experimentation, and attribution pipelines, but it is difficult to reproduce locally in a way that is faithful to production and repeatable by other researchers. Browsers often suppress `Referer`/`document.referrer` in common local setups (non‑HTTPS origins, external 302 navigations, or OS/browser trust gaps), which prevents meaningful pre‑deployment validation and undermines the reproducibility of measurement.
24
25
25
-
Reflex is a small cross‑platform command‑line tool that emulates a realistic referrer locally. It temporarily maps a chosen referrer host to the developer’s machine, serves a trusted HTTPS page with a configurable redirect method, and then navigates to the target application so the browser sets a real `Referer`. Reflex respects the web platform’s referrer policy semantics [@w3c-referrer-policy] and standard HTTP redirection behavior [@rfc9110], and leverages locally trusted certificates via mkcert [@mkcert].
26
+
Reflex is a small cross‑platform command‑line tool that emulates a realistic referrer locally. It temporarily maps a chosen referrer host to the developer’s machine, serves a trusted HTTPS page with a configurable redirect method, and then navigates to the target application so the browser sets a real `Referer`. Reflex respects the web platform’s referrer policy semantics [@w3c-referrer-policy] and standard HTTP redirection behavior [@rfc9110], and leverages locally trusted certificates via mkcert [@mkcert]. This enables researchers and engineers to reproduce and share referrer‑dependent scenarios in a single command, improving the validity of analytics and experiment instrumentation.
26
27
27
28
# Statement of need
28
29
@@ -36,6 +37,24 @@ Reflex closes this gap by providing a minimal, reproducible workflow to preview
36
37
37
38
The tool is intentionally focused: it does not alter browser settings, require extensions, or act as a full proxy. Instead, it uses a short, standards‑compliant HTTPS redirect from a local origin that mimics the selected referrer.
38
39
40
+
Minimal reproducible example. The following single command reproduces a realistic referrer across OSes using locally trusted HTTPS:
41
+
42
+
```
43
+
reflex run --referrer https://news.google.com --target https://localhost:3000/experiment
44
+
```
45
+
46
+
This opens a private/incognito browser window and performs a standards‑conformant redirect so the target observes a populated Referer (e.g., `https://news.google.com/`). The same invocation can be shared to reproduce the scenario on other machines.
47
+
48
+
49
+
50
+
# Use cases for research
51
+
52
+
- Analytics/attribution validation for controlled experiments: Researchers running online controlled experiments (A/B tests) often need to verify instrumentation and gating rules that depend on referrer context (e.g., arriving from a partner site). Reflex provides a reproducible way to preview and test these flows locally before running or analyzing experiments [@kohavi2020trustworthy].
53
+
- Cross‑browser measurement of `Referrer-Policy` and redirect methods: Web measurement studies can compare how browsers populate `Referer`/`document.referrer` under `meta`, `js`, and `302` redirects with different policies. Reflex enables these controlled tests across OSes with locally trusted TLS [@w3c-referrer-policy; @rfc9110].
54
+
- Privacy and tracking studies: Prior work shows the prevalence and risks of referrer‑based tracking and leakage on the web [@englehardt2016online; @acar2014never]. Reflex can generate reproducible referrer scenarios to validate mitigations (e.g., policy choices) or to build small‑scale datasets illustrating leakage conditions.
55
+
56
+
Expected impact. While seemingly narrow, reliable referrer emulation is a recurring prerequisite for trustworthy analytics, A/B testing, and privacy measurement. Reflex lowers the setup cost for these workflows and makes them repeatable across environments, which can reduce instrumentation regressions and improve the integrity of subsequent analyses [@kohavi2020trustworthy].
57
+
39
58
# Functionality
40
59
41
60
Reflex provides a single binary with three subcommands:
@@ -52,17 +71,30 @@ Key implementation details:
52
71
- A simple file lock avoids concurrent runs from clobbering hosts entries.
53
72
- Cross‑platform browser launchers drop elevated privileges where appropriate so the browser opens in the user’s desktop session (Linux/macOS), with optional private/incognito flags.
54
73
74
+
# Limitations and scope
75
+
76
+
Reflex is intentionally narrow in scope:
77
+
78
+
- Not a proxy or MITM: it does not intercept traffic or modify requests beyond serving a short redirect.
79
+
- Local emulation only: it is designed for local testing, not production spoofing of referrers.
80
+
- No browser reconfiguration: it avoids changing browser settings, profiles, or policies.
81
+
- Subject to site controls: site‑specific defenses (e.g., CSP, framebusting) remain in effect.
82
+
55
83
# Quality control
56
84
57
-
The repository includes unit tests for the HTTPS redirector (verifying method‑specific behavior and `Referrer-Policy` headers), hosts file management (add/remove, idempotency, bulk cleanup), local locking, and mkcert detection. Continuous Integration builds and runs tests on Linux via GitHub Actions.
85
+
The repository includes unit tests for the HTTPS redirector (verifying method‑specific behavior and `Referrer-Policy` headers), hosts file management (add/remove, idempotency, bulk cleanup), local locking, and mkcert detection. Tests generate ephemeral self‑signed certificates (no mkcert required) to isolate server behavior. Continuous Integration builds and runs tests on Linux, macOS, and Windows via GitHub Actions.
58
86
59
87
# State of the field
60
88
61
-
Developers commonly rely on ad‑hoc local servers, browser extensions, or general‑purpose proxies (e.g., mitmproxy [@mitmproxy]) to test web behavior. Automation frameworks such as Selenium [@selenium] and Playwright [@playwright] can orchestrate browser flows, but they do not specifically target reproducible referrer emulation with locally trusted HTTPS and precise `Referrer-Policy` control out‑of‑the‑box. Reflex fills this narrow but frequently encountered gap with a single‑purpose, scriptable CLI tailored to referrer‑dependent analytics and experimentation.
89
+
Developers commonly rely on ad‑hoc local servers, browser extensions, or general‑purpose proxies (e.g., mitmproxy [@mitmproxy]) to test web behavior. Automation frameworks such as Selenium [@selenium] and Playwright [@playwright] can orchestrate browser flows, but they do not specifically target reproducible referrer emulation with locally trusted HTTPS and precise `Referrer-Policy` control out‑of‑the‑box. Reflex fills this narrow but frequently encountered gap with a single‑purpose, scriptable CLI tailored to referrer‑dependent analytics and experimentation. Unlike browser extensions and flag‑based overrides, it produces a standards‑conformant HTTPS navigation with a trusted certificate and explicit `Referrer‑Policy`, yielding consistent, shareable results across browsers and OSes.
62
90
63
91
# Availability
64
92
65
-
Reflex is implemented in Go and distributed as prebuilt binaries for Linux, macOS, and Windows. Source code and issue tracking are available at: https://github.com/samfrm/reflex. An archival release is available on Zenodo (DOI: https://doi.org/10.5281/zenodo.17081049). This paper refers to version v0.1.3 of the software.
93
+
Reflex is implemented in Go and distributed as prebuilt binaries for Linux, macOS, and Windows. Source code and issue tracking are available at: https://github.com/samfrm/reflex. Reflex is MIT‑licensed (LICENSE: https://github.com/samfrm/reflex/blob/main/LICENSE) and archived per‑version on Zenodo (DOI: https://doi.org/10.5281/zenodo.17081049). This paper refers to version v0.1.3 of the software.
94
+
95
+
# History and maturity
96
+
97
+
Reflex packages a pattern I’ve used for years—local HTTPS, a short redirect, and hosts mapping—into a single CLI. I open‑sourced and packaged it recently, which is why the public commit history is short. Compared to the original scripts, the CLI adds: mkcert‑based local trust with a shared CAROOT on Linux (/etc/mkcert), tagged and backed‑up /etc/hosts edits (“# reflex‑managed”), a file lock to prevent concurrent runs, and a browser launcher that drops privileges to open a private window in the user session. The repository includes tests and CI; server tests assert the `Referrer‑Policy` and redirect bodies/headers for `meta`, `js`, and `302` methods. I’m not aware of citations yet due to the recent release, but Reflex directly supports the reproducible analytics/experimentation and privacy measurement workflows described in this paper.
0 commit comments