I am trying to write (and understand) a transparent proxy.

My setup would look like this

Client Browser ---> TProxy ----> Upstream Proxy ------> cloud

When the client browser makes a GET request, the idea is TProxy would then CONNECT to the Upstream proxy. The upstream proxy requires digest authentication. So, essentially the flow would look like

```
Client Browser ---> TProxy --------> Upstream Proxy ---------------> cloud 
GET BBC.co.uk
                    CONNECT 
                                       407 PROXY AUTH REQUIRED
                    CONNECT
               (with proxy-authorization)

                                       200 OK
                    GET BBC.co.uk

```

I am confused what happens once CONNECT with authorization succeeds.
Am I suppose to modify the original GET request now to include a 
Proxy-Authorization header?

or would the original GET request be then tunnelled in another http header something like 

```
HTTP Header
 Proxy Authorization
  HTTP Header (GET BBC.CO.UK)
  Data

```

or I can just pass the original GET request as is?

I am just starting with http and would appreciate any help.

Thanks