goproxy
goproxy copied to clipboard
Skip proxy for big files , binary , zip , iso ...
Hi to all Been playing with this and it works great. Mostly for making an adblocker at system/https level with adblock rules.
But, im not able to find a way to skip the proxy for binary files like iso , zip , rar . I tried with proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
and also without that but when I download one of those files from the browser, the browser doesnt know the full size even if that is on the headers from the server. I added some logging and I get
2025/12/04 File https://laotzu.ftp.acc.umu.se/debian-cd/current/amd64/iso-dvd/debian-13.2.0-amd64-DVD-1.iso
2025/12/04 DEBUG ISO HEADERS (ORIGINAL from server):
2025/12/04 Content-Type: [application/x-iso9660-image]
2025/12/04 Date: [Thu, 04 Dec 2025 21:32:12 GMT]
2025/12/04 Server: [Apache/2.4.62 (Unix)]
2025/12/04 Last-Modified: [Sat, 15 Nov 2025 13:17:29 GMT]
2025/12/04 Accept-Ranges: [bytes]
2025/12/04 Content-Length: [3985178624]
2025/12/04 Age: [135]
Is there a way to tell goproxy to skip processing ( proxying ) for ISO, binary , rar , tar , gz files ?
The file itself downloads OK but I presume it would be better to not waste CPU/RAM by handling/proxying those files.
Thanks