1.1.0 • Published 1 year ago

react-native-wss v1.1.0

Weekly downloads
18
License
ISC
Repository
github
Last release
1 year ago

React native WebSocket Secure

Every project what i created has problem with securing websockets.\ So, I decide to share my codes with everyone, and i hope this will be merged into react native one day.\ This library allows you to set wss address in WebSocket with ca (plain cert), pfx (base64) and passphrase.\ Small coffe makes me happy :)\

Supported react-native versions

  • v0.64.4
  • v0.64.1

Installing

Install the react-native-wss repository to devDependencies

npm i --save-dev react-native-wss

Add postinstall into project package.json scripts object

"scripts": {
  "postinstall": "node node_modules/react-native-wss/scripts/postinstall.js"
}

Run the postinstall

npm i
# or
npm run postinstall

API

Now, you can use wss address with certificates. ( No need to import any other libs. )

this._ws = new WebSocket( 'wss://192.168.0.1', [],
{
  headers: { Authorization: 'Bearer 123' },
  ca: '-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----\n',
  pfx: 'base64==',
  passphrase: 'mustbedefinedforpfx'
});

Postinstall error patch not found!

I compile only latest version of react native. ( Because of repo size )\ When you need older version of react native you need to compile android .aar manualy.\ HOW TO COMPILE ANDROID AAR.\ Do you need help? You should create issue and I can help you :)

1.1.0

1 year ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago