パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.0.0

flutter_v2ray

v2ray 接続(VPN モードおよびプロキシのみ)を可能にするプラグイン

AndroidiOS
30日間ダウンロード
2210
いいね数
98
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_v2ray

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

flutter_v2ray は、Android および iOS デバイスで V2Ray 接続を可能にする Flutter プラグインであり、VPN モードとプロキシのみの構成をサポートしています。開発者がアプリに安全でカスタマイズ可能なネットワークルーティングを統合できるようにし、制限されたコンテンツやプライベートネットワークサービスへのアクセスを容易にします。このプラグインは、V2Ray 接続の確立と管理を行うための直感的なインターフェースを提供しており、信頼性の高いパフォーマンスを実現するためにネイティブプラットフォーム機能を活用しています。高度なネットワーキング機能と強力なプライバシー制御が必要なアプリケーションにおいて特に有用です。

用途

  • セキュアなアプリケーションからサーバーへの通信
  • 地域コンテンツ制限を回避する
  • プライバシーを重視したアプリケーションの構築
  • カスタムプロキシ構成の統合
  • 暗号化されたネットワークトンネルの有効化

主な機能

  • VPNモードとプロキシのみの接続タイプの両方をサポートしています
  • クロスプラットフォーム互換性(AndroidおよびiOS)
  • 安定したパフォーマンスのためのネイティブ統合
  • 接続管理のためのシンプルなAPI
  • V2Ray JSON 設定で構成可能

適している対象

  • セキュアな通信アプリを開発する開発者
  • ネットワーク制限を回避する必要のあるアプリ
  • プライバシー志向のモバイルアプリケーション
  • ネットワークツールの統合
  • カスタムプロキシソリューション

注意事項

  • AndroidおよびiOSで適切なシステム権限が必要です
  • 複雑な V2Ray の設定には追加の構成が必要になる場合があります
  • VPN機能によるアプリストアのレビュー上の課題
  • 一部の操作は外部の V2Ray バイナリに依存しています
  • 高度な設定なしでは、基本的なHTTPリクエストには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

flutter_v2ray

Open Source Love

Table of contents

Change logs

1.0.10
  • update xray core version to 25.3.6
see more

Features

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

Supported Platforms

Platform Status Info
Android Done ✅ Xray 25.3.6
IOS Done ✅ For purchase: t.me/blueboy_tm
Desktop Done ✅ For purchase: t.me/blueboy_tm

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);


// Get Server Delay
print('${flutterV2ray.getServerDelay(config: parser.getFullConfiguration())}ms');

// 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,
        bypassSubnets: null,
        proxyOnly: false,
    );
}

// Disconnect
flutterV2ray.stopV2Ray();

Bypass LAN Traffic
final List<String> subnets = [
    "0.0.0.0/5",
    "8.0.0.0/7",
    "11.0.0.0/8",
    "12.0.0.0/6",
    "16.0.0.0/4",
    "32.0.0.0/3",
    "64.0.0.0/2",
    "128.0.0.0/3",
    "160.0.0.0/5",
    "168.0.0.0/6",
    "172.0.0.0/12",
    "172.32.0.0/11",
    "172.64.0.0/10",
    "172.128.0.0/9",
    "173.0.0.0/8",
    "174.0.0.0/7",
    "176.0.0.0/4",
    "192.0.0.0/9",
    "192.128.0.0/11",
    "192.160.0.0/13",
    "192.169.0.0/16",
    "192.170.0.0/15",
    "192.172.0.0/14",
    "192.176.0.0/12",
    "192.192.0.0/10",
    "193.0.0.0/8",
    "194.0.0.0/7",
    "196.0.0.0/6",
    "200.0.0.0/5",
    "208.0.0.0/4",
    "240.0.0.0/4",
];

flutterV2ray.startV2Ray(
    remark: parser.remark,
    config: parser.getFullConfiguration(),
    blockedApps: null,
    bypassSubnets: subnets,
    proxyOnly: false,
);

Android configuration before publish to Google Play🚀

gradle.preperties
  • add this line
android.bundle.enableUncompressedNativeLibs = false
build.gradle (app)
  • Find the buildTypes block:
buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
               signingConfig signingConfigs.release
        }
    }
  • And replace it with the following configuration info:
splits {
        abi {
            enable true
            reset()
            //noinspection ChromeOsAbiSupport
            include "x86_64", "armeabi-v7a", "arm64-v8a"

            universalApk true
        }
    }

   buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
               signingConfig signingConfigs.release
               ndk {
                //noinspection ChromeOsAbiSupport
                abiFilters "x86_64", "armeabi-v7a", "arm64-v8a"
                debugSymbolLevel 'FULL'
            }
        }
    }

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 coffee

Buy Me A Coffee

Cryptocurrency
  • BTC:
    • bc1qrtq0ygmxw7meak3ukvxn03za2j7t7s4uxuujct
  • Tron
    • TVQQdim3pxa4XoZyRRVHQ8GsY42rEgB4ow
  • USDT
    • TRC20
      • TVQQdim3pxa4XoZyRRVHQ8GsY42rEgB4ow
    • ERC20
      • 0xD5d931BB40F02Ed45172faebD805B3f0ba70Fe73
  • DogeCoin
    • DNFaHFzmUfeUB6NFgQX1sLn9q8kknTmKd8

カテゴリー

依存関係

依存関係一覧 1 件

  • plugin_platform_interface^2.0.2

ソースリポジトリ

このパッケージを使用しているプロジェクト