question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow the user to intercept the proxy tunnel connection response

See original GitHub issue

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.

When 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.

The 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: https://github.com/square/okhttp/blob/95ae0cf421c0f9c5521578781952108d1a1e1bdd/okhttp/src/main/java/okhttp3/internal/connection/RealConnection.java#L375 https://github.com/square/okhttp/blob/95ae0cf421c0f9c5521578781952108d1a1e1bdd/okhttp/src/main/java/okhttp3/internal/connection/RealConnection.java#L397

Assuming 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?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
swankjessecommented, Nov 5, 2019

@invodv nope, you can’t see those headers.

0reactions
lnvodvcommented, Nov 4, 2019

When authentication is complete, my proxy server responds in the tunnel with a 200 response code and puts some headers in that response that I need to grab.

As far as I understand, it is still not possible to inspect that proxy tunnel response (response code 200) because only authentication responses (response code 407) can be inspected with Authenticator. Is that correct @swankjesse? Or is there a way to do that I’m not seeing?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intercepting HTTP traffic with Burp Proxy - PortSwigger
Intercepting a request. Burp Proxy lets you intercept HTTP requests and responses sent between Burp's browser and the target server.
Read more >
How to intercept HTTP requests and responses using Burp Suite
Learn how to intercept HTTP requests and responses using Burp Suite, ... Using Burp Proxy, you can intercept, inspect, and modify the raw ......
Read more >
How to Intercept Requests & Modify Responses With Burp Suite
Intercepts browser traffic using a man-in-the-middle proxy.​​ You can intercept requests and responses, whether that's just to view, modify, or ...
Read more >
Interception using Burp Suite - Medium
This toggle allows you to intercept any request or response, ... Make sure the “Use proxy server for your LAN” checkbox is ticked....
Read more >
How do I (manually) intercept and return a custom message to ...
So you are developing a transparent proxy. When it comes to HTTPS traffic every proxy has the choice: Pass it without decryption ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found