build 10
This commit is contained in:
3
main.go
3
main.go
@@ -82,10 +82,11 @@ func httpHandler(w http.ResponseWriter, r *http.Request, pathname string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func proxy(w http.ResponseWriter, r *http.Request, client *http.Client, pathname string) {
|
func proxy(w http.ResponseWriter, r *http.Request, client *http.Client, pathname string) {
|
||||||
fmt.Println("Proxy: ", pathname)
|
fmt.Println("Proxy: ", pathname, "Method: ", r.Method)
|
||||||
req, _ := http.NewRequest(r.Method, pathname, r.Body)
|
req, _ := http.NewRequest(r.Method, pathname, r.Body)
|
||||||
for k, v := range r.Header {
|
for k, v := range r.Header {
|
||||||
req.Header.Set(k, strings.Join(v, ","))
|
req.Header.Set(k, strings.Join(v, ","))
|
||||||
|
fmt.Println("Header: ", k, ":", strings.Join(v, ","))
|
||||||
}
|
}
|
||||||
res, e := client.Do(req)
|
res, e := client.Do(req)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user