48 lines
1.2 KiB
Swift
48 lines
1.2 KiB
Swift
//
|
|
// SystemConfig.swift
|
|
// sdlan
|
|
//
|
|
// Created by 安礼成 on 2024/6/3.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
struct SystemConfig {
|
|
// 版本设置
|
|
static let version = 1
|
|
|
|
static let version_name = "1.1"
|
|
|
|
// 安装渠道
|
|
static let installedChannel = "MacAppStore"
|
|
|
|
// super 节点
|
|
//static let superHost = "118.178.229.213"
|
|
|
|
static let superHost = "punchnet.aioe.tech"
|
|
static let superPort = 18083
|
|
|
|
// stun探测服务
|
|
static let stunServers = "118.178.229.213:1265,1266;118.178.229.213:1265,1266"
|
|
|
|
static func getOptions(token: String, noticePort: Int) -> [String:NSObject]? {
|
|
guard let superIp = DNSResolver.resolveAddrInfos(superHost).first else {
|
|
return nil
|
|
}
|
|
let options = [
|
|
"version:": version as NSObject,
|
|
"installed_channel": installedChannel as NSObject,
|
|
"token": token as NSObject,
|
|
"super_ip": "118.178.229.213" as NSObject,
|
|
"super_port": superPort as NSObject,
|
|
"stun_servers": stunServers as NSObject,
|
|
"notice_port": noticePort as NSObject
|
|
]
|
|
|
|
print("options: \(options)")
|
|
|
|
return options
|
|
}
|
|
|
|
}
|