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

Faking ngx.var.remote_addr #155

Open
bluemmb opened this issue Nov 15, 2022 · 1 comment
Open

Faking ngx.var.remote_addr #155

bluemmb opened this issue Nov 15, 2022 · 1 comment

Comments

@bluemmb
Copy link

bluemmb commented Nov 15, 2022

Hi.

I'm testing some parts of my code which rely on ngx.var.remote_addr. Also I need to fake this value sometimes, like testing a rate limiter in which keys are generated from remote_addr value.

Is there any way to fake the values like ngx.var.remote_addr, ngx.var.host or ... for testing purposes?

@bluemmb bluemmb changed the title Faking remote_addr Faking ngx.var.remote_addr Nov 15, 2022
@zhuizhuhaomeng
Copy link
Contributor

There is no way to fake the ngx.var.remote_addr.
you can bind the local address when sending the request

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