Intercept an HTTP request at browser end to alter some html content

后端 未结 11 1703
灰色年华
灰色年华 2021-02-06 19:43

I would like to do as follows. What would be the best way? A general answer will also be fine.

I would like to intercept an HTTP request at the client end to alter some

11条回答
  •  攒了一身酷
    2021-02-06 20:04

    Taken from here.

    It can be done via a Layered Service Provider on Windows.

    From Wikipedia:

    "A Layered Service Provider (LSP) is a feature of the Microsoft Windows Winsock 2 Service Provider Interface (SPI). A Layered Service Provider is a DLL that uses Winsock APIs to insert itself into the TCP/IP stack. Once in the stack, a Layered Service Provider can intercept and modify inbound and outbound Internet traffic. It allows processing all the TCP/IP traffic taking place between the Internet and the applications that are accessing the Internet (such as a web browser, the email client, etc). "

    AdMuncher for example is intercepting and inserting http code to avoid ads. Another suggestion is to find an open-source ad blocking program and see how they've implemented it.

提交回复
热议问题