Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View websocket traffic in chrome developer tools with React Native

I'm using the WebSocket support available for React Native as documented here: https://facebook.github.io/react-native/docs/network.html

My problem is, I have no way to monitor the actual incoming/outgoing websocket traffic in chrome developer tools. I know for certain in one case, that a remote server is closing my websocket connection, but because of probably a bug I introduced in my code, the error callback is not being triggered.

Is there a way to get more debug information in chrome developer tools for React Native websockets?

like image 847
randombits Avatar asked Oct 11 '25 07:10

randombits


1 Answers

No, sorry. The short answer is that React Native sends all network traffic through the native platform's network apis, which is why they cannot be inspected in dev tools. So, the only way for you to spy on your network traffic is to use a 3rd party proxy such as...

  • CharlesProxy
  • Wireshark

For more information, see Network layer in React Native by Kureev Alexey

like image 110
Chris Geirman Avatar answered Oct 13 '25 22:10

Chris Geirman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!