8000 interceptors not working? · Issue #690 · elazarl/goproxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
interceptors not working? #690
Open
Open
@chanmaoganda

Description

@chanmaoganda

I try to use interceptors to handle filters, but it seems not to work

package main

import (
	"log"
	"net/http"

	"github.com/elazarl/goproxy"
	"github.com/sirupsen/logrus"
)

func main() {
	logrus.SetLevel(logrus.DebugLevel)
	proxy := goproxy.NewProxyHttpServer()
	proxy.Verbose = true

	logrus.Debug("Starting")
	proxy.OnRequest(goproxy.DstHostIs("www.reddit.com")).DoFunc(
		func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
			logrus.Debug("interceptor")
			return r, nil
		})
	log.Fatalln(http.ListenAn
5229
dServe(":8080", proxy))
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0