server: director

This commit is contained in:
Cadey Ratio 2017-03-26 13:02:22 -07:00
parent d65737df24
commit 2ab2f2d762
1 changed files with 6 additions and 1 deletions

View File

@ -160,6 +160,10 @@ func (s *Server) onionPath(name string) string {
return filepath.Join(s.cfg.TorDataDir, name)
}
func (s *Server) Director(r *http.Request) {
}
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.Header.Del("X-Forwarded-For")
@ -185,7 +189,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Clacks-Overhead", "GNU Ashlynn")
if strings.HasSuffix(r.Host, ".onion") {
w.Header().Add("DNT", "1")
r.Header.Add("DNT", "1")
}
if r.RequestURI == rpc.DefaultRPCPath {
@ -194,6 +198,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
rp := &httputil.ReverseProxy{
Director: s.Director,
Transport: s.ts,
FlushInterval: 1 * time.Second,
}