A React Native package (v0.5.0, released under MIT) that enables WebSocket (wss://) connections with self-signed SSL/TLS certificates by bypassing certificate validation. It uses a singleton pattern to manage connections and supports multiple concurrent WebSocket instances. Alternative to manually patching native modules for development or internal apps where strict certificate verification is not required. Includes TypeScript declarations. WARNING: Bypassing SSL validation exposes to MITM attacks and must never be used in production.
npm install react-native-websocket-self-signedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import, create a WebSocket instance for a URL (singleton per URL), and handle events.
Update to use WebSocketWithSelfSignedCert.getInstance(url) for each WebSocket URL.
Do not use in production. Only for development or internal apps where risk is acceptable.
Disable network inspector via expo-build-properties plugin in app.json (see README).
Replace localhost with 10.0.2.2 for Android emulator connections.
Ensure getInstance is called after React Native initialization (e.g., inside useEffect or after app startup).
Use this library to bypass validation, or install a proper certificate.
Use import WebSocketWithSelfSignedCert from 'react-native-websocket-self-signed'
Replace 'localhost' with '10.0.2.2' in the WebSocket URL.
Update package to v0.4.0+ and use getInstance(url).