Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change a js file content #116

Open
MansoorJafari9 opened this issue Jun 22, 2024 · 1 comment
Open

change a js file content #116

MansoorJafari9 opened this issue Jun 22, 2024 · 1 comment

Comments

@MansoorJafari9
Copy link

Hi @twitchax

How can I change content a js file and load proxy url
I mean when user open https://example.com and I proxy him to https://example2.com How can I change a js file in https://example2.com

Thanks

@twitchax
Copy link
Owner

twitchax commented Jun 23, 2024

Hello! You will need to use the WithAfterReceive hook. Essentially, you have access to the entire proxied response before it goes back down to the client. You can edit any part of the headers or content as you wish.

From the README:

.WithAfterReceive((c, hrm) =>
        {
            // Alter the content in  some way before sending back to client.
            var newContent = new StringContent("It's all greek...er, Latin...to me!");
            hrm.Content = newContent;

            return Task.CompletedTask;
        })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants