puma-dev icon indicating copy to clipboard operation
puma-dev copied to clipboard

Unable to proxy to another host

Open kausters opened this issue 4 years ago • 4 comments

Hi!

According to the readme, Puma Dev supports proxying requests to another host which is something I need. However if I try to use it I get an error:

parse 192.168.1.6:8082: first path segment in URL cannot contain colon

Using macOS 10.15.4 and puma-dev 0.13 (go1.13.7)

Any ideas?

kausters avatar Jun 05 '20 08:06 kausters

Try putting //192.168.1.6:8082 in your app definition file. It know it's funky, but it'll trick url.Parse into working correctly.

It's likely that an older golang version (<1.12) correctly parsed the url without the protocol separator. We should add tests and ensure we accept the x.x.x.x:y format.

https://github.com/puma/puma-dev/blob/5af31818ea9f4ebc2c30baa2e8b3d238bff07888/dev/app.go#L381-L401

nonrational avatar Jun 05 '20 14:06 nonrational

Yeah looks like that worked, thanks!

kausters avatar Jun 08 '20 08:06 kausters

Adding the // gives me a Bad Gateway response. I've tested that I can get to the IP on that port without puma-dev and it works fine, so the bad gateway occurs within puma-dev. I'd gladly accept some pointers! :D

brendon avatar Mar 20 '23 02:03 brendon

Figured it out. I needed to be explicit about the scheme, so add http:// to the front of the ip:port.

brendon avatar Mar 20 '23 02:03 brendon