rod
rod copied to clipboard
Add Helper or documentation about `host-resolver-rules` argument
The Chrome's host-resolver-rules can be quite handy when running local tests.
I think that it could be useful to either:
- add a note about this flag in the documentation
- add a helper to configure it in the launcher (but I'm not sure about the API)
Here is how I use it:
launch := launcher.New()
// Resolve all subdomains of `baseDomain` to localhost.
hostRules := []string{"MAP *." + baseDomain + " 127.0.0.1"}
launch.Set("host-resolver-rules", hostRules...)
What do you think?
Rod Version: v0.112.0
Yes, BTW:
launch.Set("host-resolver-rules", hostRules...)
You can use this one as an example:
https://github.com/go-rod/rod/blob/c945d86bb720cd97f6b09b87a971b149accbaee3/lib/launcher/launcher.go#L297-L303