mirror of
https://gitee.com/willfree/min-vpn-client_v2.git
synced 2026-06-03 15:36:14 +08:00
外网访问还在研究怎么写;内网(filegator)在验签情况下已经可以正常访问了
This commit is contained in:
+705
-707
File diff suppressed because it is too large
Load Diff
@@ -65,6 +65,9 @@ public class MINVpnService extends VpnService implements Handler.Callback{
|
||||
// 通信intent
|
||||
private PendingIntent mConfigureIntent;
|
||||
|
||||
// vpn 外网连接 => 支持访问国外网站
|
||||
// private MINVpnExternalConnection minVpnExternalConnection=null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
// 使用handler显示消息
|
||||
@@ -152,12 +155,21 @@ public class MINVpnService extends VpnService implements Handler.Callback{
|
||||
final String proxyHost = "";
|
||||
final int proxyPort = 0;
|
||||
|
||||
// 默认开启内网服务器的连接
|
||||
minVpnConnection = new MINVpnInnerConnection(
|
||||
this, mNextConnectionId.getAndIncrement(), server, port, secret,
|
||||
proxyHost, proxyPort, allow, packages, GlobalSetting.isSM4);
|
||||
|
||||
// 对vpn connection进行各种监听设置,并启动执行其run函数
|
||||
startConnection(minVpnConnection);
|
||||
|
||||
// 根据全局变量,判断 是否开启外网服务器的连接
|
||||
if(GlobalSetting.openFirewall){
|
||||
// final byte[] secretToExtra = SM4HelperForConnection.getRandomSeed(); // 获取随机16位长度密钥,用于对称加密
|
||||
// minVpnExternalConnection = new MINVpnExternalConnection(
|
||||
// this,mNextConnectionId.getAndIncrement(),
|
||||
// MINVpnSettingAPI.INSTANCE.getOneExtranetVpnServerInfo(),secretToExtra,
|
||||
// proxyHost,proxyPort,allow,packages,GlobalSetting.isSM4);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user