kfix/MacPin

implement host redirection via in-app VPN or socket-filter

kfix opened this issue · 2 comments

kfix commented

build some VPN support in for doing ad-hoc redirection/filtering of specific hosts' WebView requests and/or their DNS resolutions
https://github.com/lshuzhi/SimpleTunnelMacos
https://github.com/liruqi/Mume-iOS
https://developer.apple.com/reference/networkextension/netunnelprovidermanager

Chrome does this with --host-rules=MAP <src-pattern> <host:port>, EXCLUDE <pattern>
https://github.com/electron/electron/blob/master/docs/api/chrome-command-line-switches.md#--host-rulesrules

I've come across this ticket - because I'm looking for a way to host a website completely offline using a HAR / http archive file.

I think this may parallel the efforts of this ticket - because you could modify the payloads of captured har file and potentially hack things if need be in swift for more granularity.
I built this codebase for another project - but could be cherry picked.
https://github.com/johndpope/HAR-playback-swift

in one line of code you can pass a har file which allows you to swizzle / intercept http requests and modify payload of urls.

related
HTTPArchive/httparchive.org#96

UPDATE
Never mind - I find this which suits my needs.
https://github.com/webrecorder/webrecorderplayer-electron/releases/tag/v1.5.0