Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

SetRoundTripper not effective #325

@darren

Description

@darren
package main

import (
	"log"
	"net"
	"net/http"
	"net/url"

	"github.com/google/martian/v3"
)

func main() {
	p := martian.NewProxy()
	p.SetRoundTripper(
		&http.Transport{
			Proxy: func(r *http.Request) (*url.URL, error) {
				log.Printf("%v", r.URL)
				return nil, nil
			},
		},
	)
	lis, _ := net.Listen("tcp", ":8080")
	p.Serve(lis)
}
curl -x 127.0.0.1:8080 http://www.google.com/

should print http://www.google.com/, but none is print. is this working as expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions