nizwar / openvpn_flutter

A package that allow you to connect OpenVPN service with Flutter
https://pub.dev/packages/openvpn_flutter
GNU General Public License v3.0
84 stars 95 forks source link

How To Add Config File ? Please Help Me. #62

Closed rahat14 closed 1 year ago

rahat14 commented 1 year ago

Future initPlatformState() async { engine.connect(config, "USA", username: defaultVpnUsername, password: defaultVpnPassword, certIsRequired: false); if (!mounted) return; }

what to pass in config here , path to the config file or the whole file content. both of them tried did not work.

nizwar commented 1 year ago

You have to fill it with openvpn config script (file content)

rahat14 commented 1 year ago

@nizwar it showing me an error can u help me by giving an example? I am adding a configuration file. https://we.tl/t-45CzR7wXCr

nizwar commented 1 year ago

Example https://github.com/nizwar/openvpn_flutter/blob/5c9567efbf0d4c7efcce14746d1cfa3fb287db28/example/lib/main.dart

rahat14 commented 1 year ago

@nizwar thnx man. but now it is stuck on VPNStage.unknown . but the same file is running on OpenVPN windows client perfectly

kashiflab commented 1 year ago

@nizwar Please have a look into this error "stuck on VPNStage.unknown"

mekkolodziejski commented 2 months ago

Future _readFileFromAssets() async { final data = await rootBundle.loadString(_files[sharedPreferences.getInt('position')!]); List lines = data.split('\n'); StringBuffer sb = StringBuffer(); String ip = ''; int x = 0; for (var line in lines) { if (line.contains('remote ')) { ip = line.split(' ')[1]; } sb.writeln(line); x++; } FileModel fm = FileModel(config: sb.toString(), ip: ip); return fm; }