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

Unclear documentation of vegeta.NewAttacker #59

Closed
grobie opened this issue Jul 1, 2014 · 5 comments
Closed

Unclear documentation of vegeta.NewAttacker #59

grobie opened this issue Jul 1, 2014 · 5 comments

Comments

@grobie
Copy link

grobie commented Jul 1, 2014

// NewAttacker returns a pointer to a new Attacker
//
// redirects is the max amount of redirects the attacker will follow.
// timeout is the client side timeout for each request.
// addr is the local IP address used for each request.
// If nil, a local IP address is automatically chosen.
func NewAttacker(redirects int, timeout time.Duration, laddr net.IPAddr) *Attacker {
  • the third parameter is called laddr
  • it's not possible to pass nil
@tsenart tsenart closed this as completed in 258ed52 Jul 1, 2014
@grobie
Copy link
Author

grobie commented Jul 1, 2014

Thanks!

Is there a specific reason you use net.IPAddr{IP: net.IPv4zero} instead of net.IPAddr{} as DefaultLocalAddr? Seems to work as well and doesn't seem to limit it to IPv4, but I haven't tested the behavior on a IPv6 system.

p.s. s/addr/laddr/ in comment for consistency :p

@tsenart
Copy link
Owner

tsenart commented Jul 1, 2014

Using an empty net.IPAddr didn't event occurred to me. However, I don't see why the DefaultLocalAddr would limit you to IPv4. If you need to use IPv6, you can pass it in too.
I will test the empty net.IPAddr though as it may be more flexible indeed.

+1 for the consistency remark

@tsenart tsenart reopened this Jul 1, 2014
@tsenart
Copy link
Owner

tsenart commented Jul 1, 2014

I will leave the DefaultLocalAddr to what it is currently. If you need to use a local IPv6 address, you can do it both with the library and the cli.

@tsenart tsenart closed this as completed in 7c80925 Jul 1, 2014
@clarlam
Copy link

clarlam commented Dec 16, 2018

I was wondering if it's possible to have laddr='::/0' and have that switch to net.IPv6zero ?

@tsenart
Copy link
Owner

tsenart commented Dec 17, 2018

@clarlam: Please open a bug issue if something isn't working for you.

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

3 participants