ChuckerTeam / chucker

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device)
Apache License 2.0
3.93k stars 343 forks source link

Websocket log #675

Open Heroes84 opened 3 years ago

Heroes84 commented 3 years ago

:bulb: Describe the solution you'd like

I want to see websocket messages send from server and messages send from client (application)

:raising_hand: Do you want to develop this feature yourself?

MiSikora commented 3 years ago

It would be a hard task. Chucker uses interceptor API to inspect HTTP requests. Web sockets do not use this mechanism and the only thing you could do is to implement WebSocketListener and try to inspect messages. Though I say try because it is very complex task (might even not be feasible to make it properly ATM). Things to consider:

cortinico commented 3 years ago

I want to see websocket messages send from server and messages send from client (application)

Is there anything in the open-source ecosystem that is already offering this capability?

Anyway, I second what @MiSikora. I believe this will add a lot of complexity and should potentially be a separate library as it covers a quite specific use case.

abotkin-cpi commented 2 years ago

In the iOS dev world, there are products like Atlantis which work with Proxyman that end up displaying WS/WSS traffic in addition to HTTPS. I'm unaware of anything in Android that currently offers something similar though.

jd565 commented 1 year ago

Would also love to see a feature like this. Was thinking an ideal situation would be that a base chucker library knows about events and can display a list+detail screen for an event, then different libraries can register new event types. Initially would only support HTTP events, but would be more straightforward to then add websocket event (has its own model + db + list view and detail screen). Other apps using other network mechanisms can then also create their own custom events and register them - for our app would be nice to be able to add FCM and XMPP information inside the chucker list.

Given the current state of the library I'm not sure this is a straightforward thing to achieve, but would be interesting to know whether this is a direction the library would take, or whether I should explore something like this independantly.

cortinico commented 1 year ago

Given the current state of the library I'm not sure this is a straightforward thing to achieve, but would be interesting to know whether this is a direction the library would take, or whether I should explore something like this independantly.

I'm currently working on https://github.com/ChuckerTeam/chucker/issues/259 It will be possible to inject custom HTTP events inside Chucker in the future. I haven't thought about making it a fully multi-purpose data module, but shouldn't be that hard after we implement #259