flutter_v2ray 1.0.0 copy "flutter_v2ray: ^1.0.0" to clipboard
flutter_v2ray: ^1.0.0 copied to clipboard

A plugin that allow you to making v2ray connection

flutter_v2ray #

Open Source Love

Table of contents #

Features #

  • Run V2Ray Proxy & VPN Mode
  • Parsing V2Ray sharing links and making changes to them

Supported Platforms #

Platform Status
Android Done ✅
IOS Soon ❎
Desktop Soon ❎

Get started #

Add dependency #

You can use the command to add flutter_v2ray as a dependency with the latest stable version:

$ flutter pub add flutter_v2ray

Or you can manually add flutter_v2ray into the dependencies section in your pubspec.yaml:

dependencies:
  flutter_v2ray: ^replace-with-latest-version

Examples #

URL Parser #

import 'package:flutter_v2ray/flutter_v2ray.dart';

// v2ray share link like vmess://, vless://, ...
String link = "link_here";
V2RayURL parser = FlutterV2ray.parseFromURL(link);

// Remark of the v2ray
print(parser.remark);

// generate full v2ray configuration (json)
print(parser.getFullConfiguration());

Edit Configuration #

// Change v2ray listening port
parser.inbound['port'] = 10890;
// Change v2ray listening host
parser.inbound['listen'] = '0.0.0.0';
// Change v2ray log level
parser.log['loglevel'] = 'info';
// Change v2ray dns
parser.dns = {
    "servers": ["1.1.1.1"]
};
// and ...

// generate configuration with new settings
parser.getFullConfiguration()

Making V2Ray connection #

import 'package:flutter_v2ray/flutter_v2ray.dart';

final FlutterV2ray flutterV2ray = FlutterV2ray(
    onStatusChanged: (status) {
        // do something
    },
);

// You must initialize V2Ray before using it.
await flutterV2ray.initializeV2Ray();



// v2ray share link like vmess://, vless://, ...
String link = "link_here";
V2RayURL parser = FlutterV2ray.parseFromURL(link);

// Permission is not required if you using proxy only
if (await flutterV2ray.requestPermission()){
    flutterV2ray.startV2Ray(
        remark: parser.remark,
        // The use of parser.getFullConfiguration() is not mandatory,
        // and you can enter the desired V2Ray configuration in JSON format
        config: parser.getFullConfiguration(),
        blockedApps: null,
        proxyOnly: false,
    );
}

// Disconnect
flutterV2ray.stopV2Ray();

More examples #

Credits #

badvpn (tun2socks) Copyright (C) Ambroz Bizjak

All rights reserved.

Donation #

If you liked this package, you can support me with one of the following links.

Buy me a coffe #

Buy Me A Coffee

Cryptocurrency #

  • BTC:
    • bc1qrtq0ygmxw7meak3ukvxn03za2j7t7s4uxuujct
  • Tron
    • TVQQdim3pxa4XoZyRRVHQ8GsY42rEgB4ow
  • USDT
    • TRC20
      • TVQQdim3pxa4XoZyRRVHQ8GsY42rEgB4ow
    • ERC20
      • 0xD5d931BB40F02Ed45172faebD805B3f0ba70Fe73
  • DogeCoin
    • DNFaHFzmUfeUB6NFgQX1sLn9q8kknTmKd8
73
likes
0
pub points
88%
popularity

Publisher

unverified uploader

A plugin that allow you to making v2ray connection

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_v2ray