Skip to content
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

Livereload support [ more generally: ports other than 80 and 433 ] #17

Open
dts opened this issue Oct 2, 2016 · 6 comments
Open

Livereload support [ more generally: ports other than 80 and 433 ] #17

dts opened this issue Oct 2, 2016 · 6 comments

Comments

@dts
Copy link

dts commented Oct 2, 2016

It would be great to add support for additional ports (that speak HTTP-ish). Specifically, I have quite a few projects that all want a "livereload" port. I currently just open them up to the top-level docker host on project-unique ports, but it would be better to add a VIRTUAL_PORT_35736=36736 (or whatever) environment variable, and have dinghy-http-proxy open up an http-ish port at 35736 and proxy that to the appropriate host at 36736.

@codekitchen
Copy link
Owner

By HTTP-ish do you just mean "speaks HTTP"? The "ish" is throwing me off. :) As long as we're just talking about listening and proxying on dynamically configured HTTP ports, that doesn't sound like it'd be too much work.

@dts
Copy link
Author

dts commented Oct 4, 2016

I say HTTP-ish because websockets aren't really "normal" HTTP in my mind (I haven't read the spec, but my guess is they actually /are/ HTTP in the sense that matters, having an origin: header and looking generally like HTTP).

@codekitchen
Copy link
Owner

Websockets start out as a HTTP request with an Upgrade: header, which is part of the HTTP spec allowing the connection to switch to another protocol. So yeah, just supporting HTTP on other ports will support websockets as well.

@dts
Copy link
Author

dts commented Oct 4, 2016

Cool! By the way, dinghy is a candle in the dark, it's made my whole development environment unbeatably awesome.

@codekitchen
Copy link
Owner

Oh you are too kind, thanks.

If you (or anybody else) wants to take a stab at this, I think we'd basically need to iterate over all env vars with that prefix, then define additional upstream and server blocks in the "server" template https://github.com/codekitchen/dinghy-http-proxy/blob/master/nginx.tmpl#L47

I'd suggest something like HTTP_PORT_35736, which would more naturally allow us to add HTTPS_PORT_* later if we want to support SSL for these.

@dts
Copy link
Author

dts commented Oct 4, 2016

I'm not particularly good at Go, but if I get some spare time, I'll definitely look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants