roxxie-proxy-u-prod 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/index-C8me8aPT.js +3669 -0
  3. package/dist/assets/inject-B58ufVkG.js +43 -0
  4. package/embed.js +1 -1
  5. package/examples/single-page.html +2 -2
  6. package/package.json +1 -1
  7. package/runtime/index.html +3 -3
  8. package/scripts/verify.mjs +2 -2
  9. package/source/packages/chrome/src/Tab/History.test.ts +30 -0
  10. package/source/packages/chrome/src/Tab/History.ts +3 -1
  11. package/source/packages/chrome/src/index.ts +5 -0
  12. package/source/packages/chrome/src/proxy/history-state.test.ts +82 -0
  13. package/source/packages/chrome/src/proxy/roxxie.ts +9 -0
  14. package/source/packages/chrome/src/proxy/scramjet.ts +29 -11
  15. package/source/packages/inject/src/emulators/history.ts +30 -3
  16. package/source/packages/roxxie-transport/package.json +1 -1
  17. package/source/packages/roxxie-transport/src/transport.ts +26 -3
  18. package/source/packages/scramjet/packages/core/dist/scramjet.js +14 -13582
  19. package/source/packages/scramjet/packages/core/dist/scramjet.js.map +1 -1
  20. package/source/packages/scramjet/packages/core/dist/scramjet.mjs +14 -13632
  21. package/source/packages/scramjet/packages/core/dist/scramjet.mjs.map +1 -1
  22. package/source/packages/scramjet/packages/core/dist/scramjet_bundled.js +14 -13584
  23. package/source/packages/scramjet/packages/core/dist/scramjet_bundled.js.map +1 -1
  24. package/source/packages/scramjet/packages/core/dist/scramjet_bundled.mjs +14 -13634
  25. package/source/packages/scramjet/packages/core/dist/scramjet_bundled.mjs.map +1 -1
  26. package/source/packages/scramjet/packages/core/dist/types/fetch/user-agent.d.ts +31 -0
  27. package/source/packages/tracker-protocol/package.json +1 -1
  28. package/source/packages/tracker-protocol/src/index.ts +6 -1
  29. package/source/pnpm-lock.yaml +1 -1
  30. package/standalone.html +2 -2
  31. package/dist/assets/index-MRhaNu_Q.js +0 -3673
  32. package/dist/assets/inject-xtH4w5z9.js +0 -43
@@ -0,0 +1,31 @@
1
+ /**
2
+ * User-Agent forwarding.
3
+ *
4
+ * A service worker never sees User-Agent on the request it intercepts - the
5
+ * browser strips it before the fetch event - and nothing further down the proxy
6
+ * adds one. Requests therefore reached origins with no User-Agent at all, and
7
+ * servers that content-negotiate on it served their non-browser representation.
8
+ * ip.me, for instance, answers a bare `text/plain` IP address rather than its
9
+ * actual page.
10
+ *
11
+ * Kept free of the rest of the fetch pipeline's imports so it stays testable on
12
+ * its own.
13
+ */
14
+ /** The minimal surface this needs from ScramjetHeaders. */
15
+ export interface UserAgentHeaders {
16
+ get(key: string): string | null;
17
+ set(key: string, value: string): void;
18
+ }
19
+ /**
20
+ * The browser's own User-Agent, or null where no navigator is available. Cached
21
+ * because the value cannot change for the life of the worker.
22
+ */
23
+ export declare function browserUserAgent(): string | null;
24
+ /** Forces the next read to re-detect the User-Agent. Intended for tests. */
25
+ export declare function resetUserAgentCache(): void;
26
+ /**
27
+ * Send the real browser User-Agent, unless the page set one of its own. Passing
28
+ * the browser's string through unchanged keeps a proxied request
29
+ * indistinguishable from a direct one for content negotiation.
30
+ */
31
+ export declare function applyUserAgentHeader(headers: UserAgentHeaders): void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roxxie-transports-tracker-protocol",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Browser-safe control-plane contracts for the Roxxie tracker, nodes, and browsers",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,7 +26,12 @@ export const CONTROL_LIMITS = {
26
26
  maxErrorBytes: 512,
27
27
  maxCandidatesReturned: 3,
28
28
  maxIceCandidates: 256,
29
- maxNodeSessions: 512,
29
+ /**
30
+ * Ceiling on the session capacity a node may advertise. This is a sanity
31
+ * bound on the wire value, not a limit on concurrent sessions: nodes do not
32
+ * refuse sessions for exceeding their advertised capacity.
33
+ */
34
+ maxNodeSessions: 65_536,
30
35
  } as const;
31
36
 
32
37
  export type NodeLifecycleState =
@@ -341,7 +341,7 @@ importers:
341
341
  specifier: 6.0.1
342
342
  version: link:../adrift-protocol
343
343
  roxxie-transports-tracker-protocol:
344
- specifier: 1.3.0
344
+ specifier: 1.4.0
345
345
  version: link:../tracker-protocol
346
346
  ws:
347
347
  specifier: 8.21.1
package/standalone.html CHANGED
@@ -18,8 +18,8 @@
18
18
  <div id="roxxie-browser"></div>
19
19
  <script
20
20
  defer
21
- src="https://cdn.jsdelivr.net/npm/roxxie-proxy-u-prod@0.2.4/embed.js"
22
- integrity="sha384-o6wwoyCvQbj3evNh2USZSUAOc625OxxX2yUnWs7o2i4NmKGhII4Y9SxvCG03OjAk"
21
+ src="https://cdn.jsdelivr.net/npm/roxxie-proxy-u-prod@0.3.0/embed.js"
22
+ integrity="sha384-njIFCNZAx6YwA02XL4JGMzcsiVqHuTRWutGa/G1NzqEe0t0V+gWPNEe0XCTde9Q3"
23
23
  crossorigin="anonymous"
24
24
  data-roxxie-target="#roxxie-browser"
25
25
  ></script>