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

locust “local DNS” resolution #1164

Closed
ecc256 opened this issue Nov 19, 2019 · 3 comments
Closed

locust “local DNS” resolution #1164

ecc256 opened this issue Nov 19, 2019 · 3 comments

Comments

@ecc256
Copy link

ecc256 commented Nov 19, 2019

Is it possible to do something similar to cURL local DNS:
curl --resolve www.my_host.com:443:1.2.3.4 https://www.my_host.com:443/something

I.e. host www.my_host.com should be resolved by locust to 1.2.3.4.
I can do it via host header for http, but not for https with SNI...
It’s doable via local hosts entry easily.
I guess it’s doable via locust httpclient fiddling too, probably...
Is there another relatively easy way without messing up with local hosts files?

Found somewhat related already closed issues: #326 #96

@heyman
Copy link
Member

heyman commented Nov 20, 2019

The DNS resolution is currently out of Locust's control, and I currently don't see us changing that.

If you're running Locust in a Docker container, you could use the --add-host argument to docker run.

@heyman heyman closed this as completed Nov 20, 2019
@heyman heyman added the wontfix label Nov 20, 2019
@ecc256
Copy link
Author

ecc256 commented Nov 20, 2019

The DNS resolution is currently out of Locust's control, and I currently don't see us changing that.

Jonatan,
I’m not talking about “full blown” DNS.
Basically, we have a dictionary {name0: IP0, name1: IP1, …}

“Local DNS” can be done easily for HTTP protocol:
HttpClient needs to connect to IP, not name and add “host: name” header.
AFAIK, it’s trickier, but possible for HTTPS still.
I think, it won’t be much Locust code changes to implement such logic.

I can try writing examples to prove, it’s doable for both HTTP and HTTPS for Python3 standard HttpClient, any advanced HttpClient should be able to handle it too.
That is if somebody willing to integrate it into Locust later.
Don’t want to waste my time otherwise.

@heyman
Copy link
Member

heyman commented Nov 21, 2019

Ah, now I think I understand what you mean. You should be able to implement that in your own test scripts pretty easily. I don't think it's a common enough use-case for us to include it in Locust itself.

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

No branches or pull requests

2 participants