Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite core proxy, TLS MITM support, and refactor all the things. #13

Merged
merged 16 commits into from Jul 31, 2015

Conversation

admtnnr
Copy link
Contributor

@admtnnr admtnnr commented Jul 30, 2015

Things we should have:

  • Changelog
  • Versions (cut version 1 branch from commit before this?)

)

var (
addr = flag.String("addr", ":8080", "host:port of the proxy")
apiAddr = flag.String("api-addr", ":0", "host:port of the configuration API")
apiHostname = flag.String("api-hostname", "martian.proxy", "hostname forwarded to apiAddr")
generateCert = flag.Bool("generate-cert", false, "generate certificate and private key for MITM")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "CA" to message and we should document the use case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// TODO: Avoid creating real connection, spin up TLS server with fake
// certificate signed by generated CA.
//
// GET /humans.text HTTP/1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humans.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -110,30 +96,44 @@ func (f *Filter) ResponseModifier(id string) martian.ResponseModifier {

// ModifyRequest runs the RequestModifier for the associated ctx.Auth.ID. If no
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment - no longer ctx.Auth.ID, it's actx.ID()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

func (f *Filter) ModifyResponse(ctx *martian.Context, res *http.Response) error {
if resmod := f.resmods[ctx.Auth.ID]; resmod != nil {
return resmod.ModifyResponse(ctx, res)
func (f *Filter) ModifyResponse(res *http.Response) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment - no longer ctx.Auth.ID, it's actx.ID()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

admtnnr added a commit that referenced this pull request Jul 31, 2015
Rewrite core proxy, TLS MITM support, and refactor all the things.
@admtnnr admtnnr merged commit dc00fc8 into master Jul 31, 2015
@admtnnr admtnnr deleted the martian-version-two branch July 31, 2015 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants