|Virtual host / ServeMux project?||Kyle Wolfe||09.12.13 14:32|
I'm was kicking around the idea of my first real project being a standalone "virtual host" handler for routing multiple domains on port x to other services within the network like an apache virtual host would. I see that there is ServeMux however from what I am reading this would require those services to be part of the same binary since its routing to a handler.
So 1) am I missing anything that would make this project not useful and 2) anyone know of one that exists already.
|Re: [go-nuts] Virtual host / ServeMux project?||Wes Freeman||09.12.13 14:35|
Not to discourage you, but depending what you're looking for, maybe gorilla/mux can handle it?
On Mon, Dec 9, 2013 at 5:32 PM, Kyle Wolfe <kyle.a...@gmail.com> wrote:
|Re: [go-nuts] Virtual host / ServeMux project?||Wes Freeman||09.12.13 15:11|
Sorry, I guess I misunderstood and thought you just wanted to route on hostnames. So, you want to do that, but also forward requests?
|Re: Virtual host / ServeMux project?||mgutz||09.12.13 15:28|
a reverse proxy? azer/boxcars on github
|Re: Virtual host / ServeMux project?||Rick Tait||09.12.13 16:30|
i could be misunderstanding (or projecting!!!), but to me it sounds like Kyle might want a combo of gorilla/mux + nginx's vhost location+upstream functionality? gorilla/mux can certainly do it, it just isn't necessarily the prettiest (nicely packaged) thing in the whole world.
kyle, if i'm on the right track, i would LOVE to see something like this. easily-configurable multiple vhost+routing without having to recompile every time i add a new vhost (etc).
forgive if i'm way off base!
|Re: Virtual host / ServeMux project?||Kyle Wolfe||10.12.13 07:12|
gorilla/mux seems to be the same thing. it would require a restart of the service if any one of the hosts need an update because it routes to a handler. I am suggesting more of a proxy, but boxcars might be a little overkill as well.
What I had in mind would start a service on port 80 / 443 and act as a proxy to defined services based on host name. Most setups would route to localhost on a different port number.
virtualhost - port 80
foo.net -> localhost:81
bar.net -> localhost:82
sub.bar.net -> localhost:83
Now each service can be taken down independently. Most likely would have a simple web ui to add hosts without taking down the virtual host service as well and save a config file for when a restart does occur.
|Re: [go-nuts] Re: Virtual host / ServeMux project?||Sol||10.12.13 07:54|
For development I use this https://github.com/qrtz/livedevIt is not meant for production use but it might serve as starting point or just inspiration.
|Re: Virtual host / ServeMux project?||Kevin Gillette||10.12.13 11:43|
Writing a hot-reconfigurable virtual-host revproxy is pretty specific: I wouldn't expect any existing Go project that's either (but not all of) hot-reconfigurable or domain-routes or is a reverse proxy to fulfill this need. It's also not too hard to write from scratch in Go.