-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Client Configured with IPv6 Address not able to Connect to Server(Configured with IPv6 Address) Using Hostname #2084
Comments
Hi @srikr, Do I understand correctly that the server has both a v4 and v6 IP? If so you will need to tell k6 to prefer (or only) resolve ipv6 instead of the default ipv4. That can be done with the dns option as in Previous related discussions in #1733 and linked comments. As I argue in this comment it will make sense for k6 to change the policy per VU if the VU gets a specific IP as there is no way for a VU with only an ipv6 address to make a request to an ipv4 one so there is no point in resolving and giving it an ipv4 address. Although that can as well be confusing if you are told that it couldn't resolve a host but you can with |
Hi @mstoykov -srikr |
Hmm, can you post the actual error you get ? Also, can you try using the hosts option to set what it needs to be resolved to instead of |
This is the Error I am getting:
This is what I tried which also did not work, I am not sure am I configuring the hosts incorrectly: import http from "k6/http";
import { check } from "k6";
export default function() {
var param = {
headers: {"Accept": "text/html"}
};
var options = {
hosts: {
'hostname': 'ipv6 address'
}
};
check(http.get("https://hostname:443/get1.php?name=aaa", param), {
"status is 200": (r) => r.status == 200,
"protocol is HTTP/1.1": (r) => r.proto == "HTTP/1.1",
});
} |
I also tried export which also did not work, Not sure what am I missing here |
you need to export it and it to be outside the import http from "k6/http";
import { check } from "k6";
export var options = { // here in the global scope
hosts: {
'hostname': 'ipv6 address'
}
};
export default function() {
var param = {
headers: {"Accept": "text/html"}
};
check(http.get("https://hostname:443/get1.php?name=aaa", param), {
"status is 200": (r) => r.status == 200,
"protocol is HTTP/1.1": (r) => r.proto == "HTTP/1.1",
});
} |
I did just test
This is basically what is said in #1733 more or less and is what I knew will be a problem in this comment. |
I have two entries in /etc/hosts file, one for IPv4 and one for IPv6 which is why I think it is not working. I presume k6 is not able to distinguish between two IPs as it sees two entries in /etc/hosts file. |
Client Configured with IPv6 Address not able to Connect to Server(Configured with IPv6 Address) Using Hostname
Example:
get https://[IPv6 Address]:443/ -- Works Fine
get https://hostname:443/ -- Not Working Fine
Environment
Expected Behavior
get https://[IPv6 Address]:443/ -- Works Fine
get https://hostname:443/ -- Should also Work Fine with IPv6 address
Actual Behavior
get https://[IPv6 Address]:443/ -- Works Fine
get https://hostname:443/ -- Not Working Fine
Steps to Reproduce the Problem
root@MyClient1:/home/testuser# cat K6JS/http1.js
and run the following command:
The text was updated successfully, but these errors were encountered: