🚀 Socket Launch Week 🚀 Day 1: Introducing .NET Support in Socket.Learn More

react-native-websocket-ssl-pinning

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

react-native-websocket-ssl-pinning

Creates a secure WebSocket connection using ssl-pinning technique

0.4.0
unpublished
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created

react-native-websocket-ssl-pinning

Creates a secure WebSocket connection using ssl-pinning technique.

Installation

Add the following line in the "dependencies" field inside package.json of the project:

"react-native-websocket-ssl-pinning": "git+ssh://git@github.com:CareHawk/react-native-websocket-ssl-pinning.git#master",

Usage

Create the connection

import { fetch } from 'react-native-websocket-ssl-pinning';

try{
  const response = await fetch(`wss://${serverip}/`, {
	method: 'GET',
	timeoutInterval: 10000, // Request timeout
	sslPinning: {
	  certs: ['rootCA_public'],
	},
  });
  
  if (response.code === 101) {
	console.log(
	  'Switching protocols. Starting secure web socket connection...',
	);

	socketOpen()
  }
} catch(e) {
  console.error(e);
}

TODO: finish usage

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Made with create-react-native-library

FAQs

Package last updated on 11 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts