Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

connect vpn programmatically react native for android ios

$
0
0

I am new to react native, I want to make a VPN client app for Android and IOS. VPN protocol should be IPSec or IKEv2 or any other. I have tried these:

1. OpenVPN

node-openvpn and openvpn-bin but no luck

const openvpnmanager = require('node-openvpn'); **const opts = {  host: '127.0.0.1', // normally '127.0.0.1', will default to if undefined  port: 1337, //port openvpn management console  timeout: 1500, //timeout for connection - optional, will default to 1500ms if undefined  logpath: 'log.txt' //optional write openvpn console output to file, can be relative path or absolute};const auth = {  user: 'vpnUserName',  pass: 'vpnPassword',};const openvpn = openvpnmanager.connect(opts)// will be emited on successful interfacing with openvpn instanceopenvpn.on('connected', () => {  openvpnmanager.authorize(auth);})

2. react native open settings

react-native-device-setting and react-native-open-settings in which they have showed to programmatically open android phone settings like:

install package: npm install react-native-device-settings --save

usage:

import DeviceSettings from 'react-native-device-settings';DeviceSettings.open(); // Open settings menuDeviceSettings.app(); // Open app settings menuDeviceSettings.wifi(); // Open wifi settings menu

but there is no method to open VPN Settings and configure VPN. 47306057 has also asked the same problem

Can anyone help me out in this? Thanks


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>