|Virtual host / ServeMux project?||Kyle Wolfe||12/9/13 2:32 PM|
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||12/9/13 2:35 PM|
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||12/9/13 3:11 PM|
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||12/9/13 3:28 PM|
a reverse proxy? azer/boxcars on github
|Re: Virtual host / ServeMux project?||Rick Tait||12/9/13 4:30 PM|
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||12/10/13 7:12 AM|
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||12/10/13 7:54 AM|
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||12/10/13 11:43 AM|
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.