-
Notifications
You must be signed in to change notification settings - Fork 12
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
Agent IP addresses #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid overall, just a note about some code repetition that seems present with getHostIPAddrs()
. If it's possible to lift them out as a utility function instead, I think it'd be cleaner.
agent/agent_util.go
Outdated
} | ||
return ipAddrs, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty similar to getLocalIPv4Addresses()
in proxy_receiver_http.go, do you think you can lift both out to reduce code repetition?
Possible untested solution: move getLocalIPv4Addresses()
from proxy_receiver_http.go to proxy_util.go, update the function call in getReachableUrls()
to just GetLocalIPv4Addresses()
, then call proxy.GetLocalIPv4Addresses()
in agent.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I didn't know about that code. I'll try and pull it out, probably add it to agent_util.go since its functionality would be used outside of proxy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: depends on mitre/caldera#2056
… the host.