{"action":"created","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/4301","repository_url":"https://api.github.com/repos/square/okhttp","labels_url":"https://api.github.com/repos/square/okhttp/issues/4301/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/4301/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/4301/events","html_url":"https://github.com/square/okhttp/issues/4301","id":366325605,"node_id":"MDU6SXNzdWUzNjYzMjU2MDU=","number":4301,"title":"Allow the user to intercept the proxy tunnel connection response","user":{"login":"lnvodv","id":43814874,"node_id":"MDQ6VXNlcjQzODE0ODc0","avatar_url":"https://avatars0.githubusercontent.com/u/43814874?v=4","gravatar_id":"","url":"https://api.github.com/users/lnvodv","html_url":"https://github.com/lnvodv","followers_url":"https://api.github.com/users/lnvodv/followers","following_url":"https://api.github.com/users/lnvodv/following{/other_user}","gists_url":"https://api.github.com/users/lnvodv/gists{/gist_id}","starred_url":"https://api.github.com/users/lnvodv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnvodv/subscriptions","organizations_url":"https://api.github.com/users/lnvodv/orgs","repos_url":"https://api.github.com/users/lnvodv/repos","events_url":"https://api.github.com/users/lnvodv/events{/privacy}","received_events_url":"https://api.github.com/users/lnvodv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-03T12:55:31Z","updated_at":"2018-10-10T12:10:27Z","closed_at":null,"author_association":"NONE","body":"I use a HTTP proxy that sends back some information in the response headers, i.e. before sending the response back to me, it adds a header with some information in it.\r\n\r\nWhen we make a HTTPS connection over an HTTP proxy, a CONNECT request is sent to the proxy. This is when the proxy responds with an additional header. \r\n\r\nThe problem is there is currently no way (as far as I know) for the user to access the headers of the CONNECT response. I believe everything happens in `RealConnection.createTunnel()` where the Response is dropped and the user has no way to intercept it:\r\nhttps://github.com/square/okhttp/blob/95ae0cf421c0f9c5521578781952108d1a1e1bdd/okhttp/src/main/java/okhttp3/internal/connection/RealConnection.java#L375\r\nhttps://github.com/square/okhttp/blob/95ae0cf421c0f9c5521578781952108d1a1e1bdd/okhttp/src/main/java/okhttp3/internal/connection/RealConnection.java#L397\r\n\r\nAssuming I haven't missed an obvious way to access this Response, does this constitute a valid feature request? What do you think would be the best way to implement this?"},"comment":{"url":"https://api.github.com/repos/square/okhttp/issues/comments/428547526","html_url":"https://github.com/square/okhttp/issues/4301#issuecomment-428547526","issue_url":"https://api.github.com/repos/square/okhttp/issues/4301","id":428547526,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODU0NzUyNg==","user":{"login":"lnvodv","id":43814874,"node_id":"MDQ6VXNlcjQzODE0ODc0","avatar_url":"https://avatars0.githubusercontent.com/u/43814874?v=4","gravatar_id":"","url":"https://api.github.com/users/lnvodv","html_url":"https://github.com/lnvodv","followers_url":"https://api.github.com/users/lnvodv/followers","following_url":"https://api.github.com/users/lnvodv/following{/other_user}","gists_url":"https://api.github.com/users/lnvodv/gists{/gist_id}","starred_url":"https://api.github.com/users/lnvodv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnvodv/subscriptions","organizations_url":"https://api.github.com/users/lnvodv/orgs","repos_url":"https://api.github.com/users/lnvodv/repos","events_url":"https://api.github.com/users/lnvodv/events{/privacy}","received_events_url":"https://api.github.com/users/lnvodv/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T12:10:27Z","updated_at":"2018-10-10T12:10:27Z","author_association":"NONE","body":"Now that I'm thinking of it, it might be useful to also let the user intercept the tunnel Request. \r\n\r\nCurrently, the tunnel Request is defined with hardcoded headers (like the User-Agent) that the user might want to customize:\r\nhttps://github.com/square/okhttp/blob/95ae0cf421c0f9c5521578781952108d1a1e1bdd/okhttp/src/main/java/okhttp3/internal/connection/RealConnection.java#L420\r\n\r\nAny thoughts @swankjesse?"}}
{"actor":{"display_login":"lnvodv"}}