V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
playboy0
V2EX  ›  问与答

基于 H5 的网页代理是如何实现的呢?

  •  
  •   playboy0 · 54 天前 · 1232 次点击
    这是一个创建于 54 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1. 高校很多都采用了一种基于浏览器的网页代理( webvpn ),这种方式似乎是许多年前过墙的方式,这种方式是如何处理页面中大量静态资源的?
    2. 这种工作方式下,webvpn 是算反向代理还是正向代理呢?
    3. 想不明白 nginx 这些做反向代理好像是工作在应用层,如何处理静态资源的?

    谢谢大家。

    8 条回复    2024-08-01 15:22:15 +08:00
    totoro625
        1
    totoro625  
       54 天前
    可以参考一下这个项目: https://github.com/netptop/siteproxy
    Vitumoc
        2
    Vitumoc  
       54 天前
    @totoro625 代码都是混淆的,还是没看懂是怎么实现的。
    oneisall8955
        3
    oneisall8955  
       54 天前
    @Vitumoc 未混淆之前看过源码,核心是代理+响应体替换
    DIO
        4
    DIO  
       54 天前 via Android
    相关好用的项目有推荐吗
    totoro625
        5
    totoro625  
       54 天前   ❤️ 1
    Vitumoc
        6
    Vitumoc  
       54 天前
    看了一下,可以回答题主了:
    学校用的,这个帖子有讨论
    Vitumoc
        7
    Vitumoc  
       54 天前
    看了一会,可以回答题主了:

    学校用的,这个帖子有讨论,结论就是技术上是反向代理,然后有成熟的供应商

    https://www.v2ex.com/t/979011



    至于这个项目 https://github.com/netptop/siteproxy 这种代理方式,自述中有原理:

    1. user browser url: https://siteproxy.herokuapp.com/https/www.google.com
    2. siteproxy.herokuapp.com received the url and request www.google.com, and get response from www.google.com
    3. siteproxy replace all returned strings in javascript/html:
    https://www.google.com => https://siteproxy.herokuapp.com/https/www.google.com
    url(/xxx) => url(/https/www.google.com/xxx)
    https://xxx => https://siteproxy.herokuapp.com/https/xxx
    etc.
    4. send back the modified html/javascript to user browser.
    playboy0
        8
    playboy0  
    OP
       53 天前
    @Vitumoc #7 🙏谢谢兄弟
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3205 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:22 · PVG 19:22 · LAX 04:22 · JFK 07:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.