New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@leaf-x/ali-cloud-gateway

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leaf-x/ali-cloud-gateway

Ali cloud gateway.

  • 2.1.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Gateway

Ali cloud gateway.

Installation

npm install @leaf-x/ali-cloud-gateway --save

Parameters

NameDefault ValueDescription
appKeyRequired fieldGateway authorization application key.
appSecretRequired fieldGateway authorization application secret.
stageRELEASEGateway runtime environment.
timeout3000Set the global request timeout.
headersSet the global request headers.

Use

import {gateway} from '@leaf-x/ali-cloud-gateway';

const {request,socket} = gateway({
  appKey: '2135455621223',
  appSecret: 'MjEzNTQ1NTYyMTIyMw==',
  stage: "RELEASE,
});

// Request
await request('https://www.leaf-x.app/').then(result=> console.info(result));

// Socket
socket.connect();

socket.on('OPEN', (success: string) => {
// do something
});

socket.on('CLOSE', (success: string) => {
// do something
});

socket.on('MESSAGE', (message: string) => {
 // do something
});

socket.on('ERROR', (error: Record<string, unknown>) => {
// do something
});

socket.on('SIGN_UP', (success: string) => {
// do something
});

socket.on('SIGN_OUT', (success: string) => {
// do something
});

socket.on('HEARTBEAT', (success: string) => {
// do something
});

SOCKET.on('RECONNECT', (success: string) => {
// do something
});

SOCKET.on('SEND', (data: Record<string, unknown>) => {
// do something
});

socket.send("https://www.leaf-x.app/");

socket.close();

React Native

npm install @leaf-x/ali-cloud-gateway --save npm install react-native-url-polyfill --save

import 'react-native-url-polyfill/auto';

react-native-crypto

npm install --save react-native-crypto

install peer deps

npm install --save react-native-randombytes react-native link react-native-randombytes # on RN >= 0.60, instead do: cd iOS && pod install

install latest rn-nodeify

npm install --save-dev rn-nodeify

install node core shims and recursively hack package.json files
in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings

./node_modules/.bin/rn-nodeify --hack --install

rn-nodeify will create a shim.js in the project root directory
// index.ios.js or index.android.js
// make sure you use `import` and not require!
import './shim.js';
import crypto from 'crypto';
// ...the rest of your code

FAQs

Package last updated on 01 Mar 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc