samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

Introduce a `transport` type to write HTTP requests to a `net.Conn` #61

Closed samuong closed 3 years ago

samuong commented 3 years ago

The purpose of this change is to reduce code duplication in authenticator.go. Previously, we needed to have two separate implementations of the NTLM handshake: one for CONNECT requests (which are written directly to a net.Conn) and another for all other requests (which are sent via an http.Transport). Now that we only need one (written against any http.RoundTripper), it will be simpler to implement additional authentication protocols in the future, such as Kerberos.