Add ramdisk script, add commented proxying log

This commit is contained in:
Bel LaPointe
2018-10-12 09:11:08 -06:00
parent 91d69f9105
commit 2bdf518440
2 changed files with 23 additions and 2 deletions

View File

@@ -15,7 +15,6 @@ import (
)
type Server struct {
addr string
transport *http.Transport
}
@@ -31,7 +30,6 @@ func NewServer(addr, clientcrt, clientkey, servercrt string) (*Server, error) {
return nil, err
}
return &Server{
addr: addr,
transport: &http.Transport{
Proxy: func(*http.Request) (*url.URL, error) {
return url.Parse(addr)
@@ -53,6 +51,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
// proxy via stuncaddsies
//logger.Log("Proxying", r.URL.String())
proxy := httputil.NewSingleHostReverseProxy(pathlessURL(r.URL))
proxy.Transport = s.transport
proxy.ServeHTTP(w, r)