- An Intro to JavaScript Proxy | CSS-Tricks1
- Javascript Proxies : Real World Use Cases – Arbaz Siddiqui2
- JavaScript Proxy with Storage
- Getting Started with JavaScript Proxy Object3
- Evan You on Proxies - Advanced Components | Vue Mastery4
Reflect
- JavaScript: Why Reflect APIs?
- JavaScript Proxy. 근데 이제 Reflect를 곁들인 | TOAST UI :: Make Your Web Delicious!
- The global
Reflectobject, its use cases and things to watch out for | Stefan Judis Web Development - How JavaScript works: Proxy and Reflect | by Ukpaiugochi | SessionStack Blog
- Reflection at Reflect: The Reflect and Proxy APIs | Reflect
Footnotes
요청 본문은 한 번만 읽을 수 있다.1 누가 미리 읽었는지는 읽기 메서드를 Proxy 로 감싸서 찾는다.
const bodyReadingMethods = ['arrayBuffer', 'blob', 'formData', 'text', 'json']
bodyReadingMethods.forEach((methodName) => {
request[methodName] = new Proxy(request[methodName], {
apply(...args) {
console.trace(`Premature "request.${methodName}" call!`)
return Reflect.apply(...args)
},
})
})
https://redd.one/blog/debugging-like-a-pro-xy
Footnotes
-
Using the Fetch API - MDN: “if any content has been read from the stream, then the stream is disturbed, and nothing else can read from the stream.” / “This means it’s not possible to read the same response (or request) body more than once” ↩
데스크톱 없이 안드로이드 Chrome 디버깅 — 로컬 프록시로 Origin 검사 우회
데스크톱 없이 안드로이드 기기 한 대로 그 기기의 Chrome을 디버깅한다. 순서를 기억하려고 적어둔 것이다 — 각 단계의 방법이 아니라 밟는 차례가 내용이다.
막히는 건 Origin 검사 하나다.1
Footnotes
-
Origin 검사(Chrome 111~)와 DNS rebinding을 막는 Host 헤더 검사(Chrome 66~)는 다른 방어다. 여기 걸리는 건 앞쪽 — WS 핸드셰이크에
--remote-allow-origins에 없는 Origin이 붙으면 거부된다. (Chromium issues) ↩