react-native-debugger
react-native-debugger copied to clipboard
See Websocket traffic on WS Network tab
React Native Debugger app version: 0.7.12 React Native version: 0.49.5 Platform: iOS Is real device of platform: No Operating System: macOS
We use Websockets for some communication with our server, but it doesn't show up under WS
in the Network tab on the iOS Simulator. Normal fetch traffic does. Any reason for this or is there a way to make this traffic visible?
Currently we only support XHR for that with some limitations. We could try replace RN's WebSocket for enabled Network inspect.
@jhen0409 Could you expand your answer? What did you mean for "try to replace RN's"?
hello @jhen0409 ! can u provide more information about your suggestion?
Hey, we had a PR for this: https://github.com/jhen0409/react-native-debugger/pull/322 But there is a drawback that a lot of warnings are being thrown when you close react inspector. If anyone is interested you could try to make it work.
if (process.env.NODE_ENV === 'development') { GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest GLOBAL.WebSocket = GLOBAL.originalWebSocket || GLOBAL.WebSocket }
@sunlei4076 Would be nice if you could write some little explanation of what it does. 👍🏽