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.

Consider updating docs/readme to addNetworkInterceptor() instead of addInterceptor()

See original GitHub issue

⚠️ Is your feature request related to a problem? Please describe

I recently had an issue where I couldn’t see my headers in the request tab. I use chucker as an on-device replacement for chalres proxy and so not showing okhttp headers by default (like the docs show) is sub-par imo. So I’m basically turning this comment by @MiSikora into a proper feature request. https://github.com/ChuckerTeam/chucker/issues/758#issuecomment-1007020678

💡 Describe the solution you’d like

Update docs from

// Don't forget to plug the ChuckerInterceptor inside the OkHttpClient
val client = OkHttpClient.Builder()
        .addInterceptor(chuckerInterceptor)
        .build()

to

// Don't forget to plug the ChuckerInterceptor inside the OkHttpClient
val client = OkHttpClient.Builder()
        .addNetworkInterceptor(chuckerInterceptor) // use network interceptor if you want to show all network traffic (like a proxy would)
        // or
        .addInterceptor(chuckerInterceptor) // use an application interceptor if you want to show... idk why you would want an app interceptor honestly. 🤷‍♀️ )
        .build()

📄 Additional context

As per the okhttp docs… Network Interceptors “Observe the data just as it will be transmitted over the network.” so to me… chucker is a library that is made to replace a proxy a proxy is used to observes data over the network why recommend/guide users towards using an application interceptor?

Anyway. I just hope some minor changes to docs will help someone make an informed decision when adding the library, vs just following the docs for adding an app interceptor.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ColtonIdlecommented, Jan 7, 2022

I didn’t open a PR because I didn’t know if there were some advantages to app vs network (you highlighted a good one though “not polluting chucker with redirect responses”

I can try to look up some more pros and cons to try to compare them at some point in the future.

0reactions
ColtonIdlecommented, Jan 15, 2022

I found out today that charles also shows redirects and so im okay with them because i want chucker to replaces charles. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · ChuckerTeam/chucker - GitHub
Consider updating docs/readme to addNetworkInterceptor() instead of addInterceptor() documentation. #759 opened on Jan 7 by ColtonIdle.
Read more >
Android Retrofit 2, differences between addInterceptor ...
Could tell me someone which are the differences between the responses? why this line new String(response.body().bytes() ); return different ...
Read more >
ChuckerTeam/chucker Issues - Giters
Updated 5 days ago 1 ... Updated 15 days ago 12 ... Consider updating docs/readme to addNetworkInterceptor() instead of addInterceptor().
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