From 0cdb9e6a52f69ebee635d5bfaa34a52f6059dd47 Mon Sep 17 00:00:00 2001 From: MO-Lewis Date: Tue, 18 Jul 2023 13:56:08 -0700 Subject: [PATCH] - added: Websocket Module setCustomClientBuilder (#37798) Summary: Added code previously added in the following PR: https://github.com/facebook/react-native/pull/28659. The above PR was accidentally scrapped due to the renaming of the master branch on the React Native repo. As advised in this comment: https://github.com/facebook/react-native/issues/37770#issuecomment-1582476332, I'm opening a new PR with the same code to get this merged into master / main. Currently, we need to run a local fork of React Native and manually apply these changes ourselves. This then causes additional issues, as it's currently _**impossible**_ to build React Native from source when running on a Windows machine, as evidenced in https://github.com/facebook/react-native/issues/37770 and the other linked issues nested inside of this issue. **Original summary is as follows:** With `NetworkModule.setCustomClientBuilder` we can customize our OkHttpClient to all requests made by react-native, it's very useful when you do `SSL Pinning` or change some OkHttpClient configuration at all. I've added a similar function to websocket, it allow us do some configurations on Websocket OkHttpClient. ## Changelog: [Android] [Added] - Websocket Module setCustomClientBuilder