net/http/httputil.ReverseProxy should do it https://pkg.go.dev/net/http/httputil#ReverseProxy
I think it's easier if you set it up as a standard server and configure a SingleHostReverseProxy as a handler for each of the upstreams On Sunday, June 6, 2021 at 10:28:15 AM UTC+2 Sebastien Binet wrote: > hi, > > I am trying to setup a little self-hosted http(s) server at home. > it should be able to serve the following: > > - https://example.com/x/pkg1 [a 'go-get'-able Go pkg] > - https://example.com/x/pkg2 [ditto] > - https://example.com/mumble [a mumble server for family and friends] > - https://example.com/clown [a whole ownCloud server instance] > - https://example.com/upspin [a Upspin server instance] > > ideally, the server behind 'example.com' would be my rpi-4, hosting a > single Go-based http(s) server that would redirect/route calls to > /mumble and /clown to the correct 3rd-party (resp.) Mumble and ownCloud > server (on the same rpi-4, at dedicated ports, say :8001 and :8002), > while handling the vanity imports locally. > (and with x/crypto/acme/autocert to handle certificates). > > is that possible? > any pointers to tutorials and/or packages to do such a thing? > > thanks, > -s > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/94dafa22-c17e-4152-8257-61531965fc17n%40googlegroups.com.