<commit_before># DevProxy

A proxy that connects requests made to certain hosts to an arbitrary backend
server, called the doppelgänger.  Example the first (note that the “real”
address and port where `example.com` would be served from is irrelevant):

1. devproxy is configured with 127.0.0.1:8080 as the HTTP doppelgänger for
   example.com
2. The client requests http://example.com/gnorc
3. devproxy connects to 127.0.0.1:8080
4. devproxy requests `/gnorc`
5. devproxy copies the request headers to the doppelgänger, including
   `Host: example.com`
6. devproxy copies the doppelgänger’s full response to the client

Example the second:

1. devproxy is configured with 127.0.0.1:8443 as the TLS doppelgänger for
   example.com
2. The client requests a connection to `example.com:443`
3. devproxy connects to 127.0.0.1:8443 and tells the client “OK”
4. The client and the doppelgänger do a TLS handshake, which succeeds
   without warnings if the doppelgänger has the `example.com` certificate and
   key available to it
5. The client makes an request with `Host: example.com` inside the tunnel
6. The doppelgänger processes the request and returns a response via the
   tunnel

Swapping the backend server is the extent of devproxy’s meddling, so it has no
need to MITM the secure connection.  It doesn’t need to modify that traffic,
it just shuttles bytes.


# Using it

1. Copy config.go.sample to config.go
2. Edit as desired
3. `go install github.com/elazarl/goproxy` if you don’t have it
4. `go build`
5. Run devproxy (Linux/OS X) or devproxy.exe (Windows)
6. Set your web proxy to 127.0.0.1:8111
<commit_msg>Update build instructions in README.<commit_after># DevProxy

A proxy that connects requests made to certain hosts to an arbitrary backend
server, called the doppelgänger.  Example the first (note that the “real”
address and port where `example.com` would be served from is irrelevant):

1. devproxy is configured with 127.0.0.1:8080 as the HTTP doppelgänger for
   example.com
2. The client requests http://example.com/gnorc
3. devproxy connects to 127.0.0.1:8080
4. devproxy requests `/gnorc`
5. devproxy copies the request headers to the doppelgänger, including
   `Host: example.com`
6. devproxy copies the doppelgänger’s full response to the client

Example the second:

1. devproxy is configured with 127.0.0.1:8443 as the TLS doppelgänger for
   example.com
2. The client requests a connection to `example.com:443`
3. devproxy connects to 127.0.0.1:8443 and tells the client “OK”
4. The client and the doppelgänger do a TLS handshake, which succeeds
   without warnings if the doppelgänger has the `example.com` certificate and
   key available to it
5. The client makes an request with `Host: example.com` inside the tunnel
6. The doppelgänger processes the request and returns a response via the
   tunnel

Swapping the backend server is the extent of devproxy’s meddling, so it has no
need to MITM the secure connection.  It doesn’t need to modify that traffic,
it just shuttles bytes.


# Using it

1. Edit [devproxy/config.go](./devproxy/config.go) to configure what servers
   should be intercepted
2. `go install github.com/elazarl/goproxy` if you don’t have it
3. `go build ./devproxy`
4. Run devproxy (Linux/OS X) or devproxy.exe (Windows)
5. Set your web proxy to 127.0.0.1:8111

{'fraction_non_alphanumeric': 0.06731059462722608, 'fraction_numerical': 0.042559613643223665, 'mean_word_length': 4.013615733736763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545426', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1026, 'n_words': 482}