rod icon indicating copy to clipboard operation
rod copied to clipboard

Add Helper or documentation about `host-resolver-rules` argument

Open gnuletik opened this issue 1 year ago • 1 comments

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

gnuletik avatar Nov 17 '22 11:11 gnuletik

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

ysmood avatar Nov 17 '22 13:11 ysmood