diff options
| -rw-r--r-- | roseh.moe.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index 180ce5f..a7842b7 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -1268,6 +1268,16 @@ func main() { cgitCGI.PathLocationHandler = cgitCGI codeMux.Handle("/", &timeoutHandler{h: cgitCGI, timeout: 5 * time.Minute}) serverMux.Handle("code."+selfURL.Hostname()+"/", &gzipHandler{codeMux}) + transmissionURL, err := url.Parse("http://127.0.0.1:9091") + if err != nil { + log.Fatal(err) + } + serverMux.Handle("downloads."+selfURL.Hostname()+"/", &authHandler{h: &httputil.ReverseProxy{ + Rewrite: func(r *httputil.ProxyRequest) { + r.SetURL(transmissionURL) + r.SetXForwarded() + }, + }}) server := &http.Server{ Handler: &loggingHandler{serverMux}, |
