Skip to content

how to rewrite html body #796

@dabeike

Description

@dabeike

how to change the contents of html,when the page is received from proxy?
my aim is to add some html code to the page,when the page returns to client
the code is like followings:

proxy.on('proxyRes', function (proxyRes, request, response){
     proxyRes.on('end',function(){
            if(proxyRes.headers['content-type']=='text/html;charset=utf-8'){
                proxyRes.write('hhhhhhhhhhh');   //this sentence may be wrong
            }
        })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions