Access target via browser

I have a Go project that will authenticate with Boundary and create an open TCP tunnel on a local port.

source: 127.0.0.1:8080
target: example.com

I am also using an AWS ALB target group that has a listener rule for host: example.com. I can get to the site a few ways:

  • through cli (not browser): curl -v https://example.com:8080/ --resolve examplecom:8080:127.0.0.1.
  • /etc/hosts file: adding 127.0.0.1 example.com to the host file will allow me to access via browser.
  • Listener rule on ALB: I can access 127.0.0.1:8080 in the browser with the listener rule with no host rule.

Possible solutions:

  • have Go add to the /etc/hosts file, which would require sudo.
  • run a local DNS and add it as a resolver, can be done in Go, however not sure if it will work with windows as well.
  • for multiple target sites, have the listener rules match for path instead of host
  • add a proxy server that will return 127.0.0.1:8080 on example.com host.

My question is, what is the best way of using the Boundary Go SDK to access the target site on a browser?