@voiceofamerica/psiphon-cordova-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.12.9 • Public • Published

Psiphon Cordova Plugin

A plugin to send all traffic from cordova web view through a Psiphon tunnel


Installation

To install the plugin, issue the following command in your cordova app directory:

cordova plugin add @voiceofamerica/psiphon-cordova-plugin

Usage

NOTE:

  • The psiphon tunnel will not be started until you start it manually.
  • Like most cordova plugins, you must wait for the deviceready event before you can start using this plugin.

Configuring & Starting tunnel

ES 2016

import { config, start, pause } from 'psiphon-cordova-plugin'

// your psiphon configuration file
import psiphonConfig from './psiphon-config.json'

document.addEventListener("deviceready", () => {
  config(psiphonConfig, () => {
    start(() => {
      alert('psiphon tunnel opened!')
    })
  })
}, false)

ES pre-2016

// your psiphon configuration file
var psiphonConfig = '{ ... }'

document.addEventListener("deviceready", function () {
  window.psiphon.config(psiphonConfig, function () {
    window.psiphon.start(function () {
      alert('psiphon tunnel opened!')
    })
  })
}, false)

Additional notes

Any traffic that is made before the start() function is called will not be made through the tunnel. To guarantee that all requests are made through the tunnel, make sure this call is made before any network requests.

Readme

Keywords

Package Sidebar

Install

npm i @voiceofamerica/psiphon-cordova-plugin

Weekly Downloads

0

Version

0.12.9

License

ISC

Unpacked Size

72.5 MB

Total Files

35

Last publish

Collaborators

  • jlandrum_voa
  • voamobileapp
  • duluca
  • ggathman
  • adamhammouda