forwardproxy.go 334 B

12345678910111213141516171819202122
  1. package forwardproxy
  2. import (
  3. "fmt"
  4. "net/http"
  5. "imuslab.com/zoraxy/mod/auth"
  6. )
  7. type ZrFilter struct {
  8. auth *auth.AuthAgent
  9. }
  10. type Handler struct {
  11. Port int
  12. }
  13. func (it ZrFilter) IsAuthorized(w http.ResponseWriter, r *http.Request) bool {
  14. u, p, ok := r.BasicAuth()
  15. fmt.Println(u, p, ok)
  16. return true
  17. }