Comments (6)
Attached到extension的进程上调试,十有八九是 GeoIP.database = MMDB("PATH_TO_THE_DATABASE")!
没设
from nekit.
Attached到extension的进程上调试,十有八九是
GeoIP.database = MMDB("PATH_TO_THE_DATABASE")!
没设
多谢回复,但是问题还是存在。。。
背景是这样,为了适配Xcode 11,我升级了NEKit 的库,目前是swift 4.2。关于连接SS的配置都没变动,PacketTunnel里面的相关配置如下。
情况说明:未加上GeoIP.database = MMDB("PATH_TO_THE_DATABASE")!,连接成功,但是过一会就自动断开。加上了直接就连接失败了
` var address: String = ""
var post: Int = 82
var password: String = ""
var algorithm: CryptoAlgorithm = .CHACHA20
var rulesDic: [String:Any] = [:]
address = configure[addressKey] as? String ?? ""
if let postString = configure[portKey] as? String {
post = Int(postString) ?? 82
}
password = configure[passwordKey] as? String ?? ""
if let algorithmString = configure[methodKey] as? String {
if algorithmString == "CHACHA20" {
algorithm = .CHACHA20
}
if algorithmString == "AES-128-CFB" {
algorithm = .AES128CFB
}
if algorithmString == "AES-192-CFB" {
algorithm = .AES192CFB
}
if algorithmString == "AES-256-CFB" {
algorithm = .AES256CFB
}
if algorithmString == "SALSA20" {
algorithm = .SALSA20
}
if algorithmString == "RC4-MD5" {
algorithm = .RC4MD5
}
}
if let rulesDicJsonData = (configure[rulesKey] as? String)?.data(using: String.Encoding.utf8) {
if let rules = (try? JSONSerialization.jsonObject(with:rulesDicJsonData, options: [])) as? [String:Any] {
rulesDic = rules
}
}
// 协议混淆
let obfuscater = ShadowsocksAdapter.ProtocolObfuscater.OriginProtocolObfuscater.Factory()
// 算法
let cryptor = ShadowsocksAdapter.CryptoStreamProcessor.Factory(password: password, algorithm: algorithm)
let stream = ShadowsocksAdapter.StreamObfuscater.OriginStreamObfuscater.Factory()
// GeoIP.database = MMDB("/path/GeoIP2-City.mmdb")!
// ss适配器
let ssAdapterFactory = ShadowsocksAdapterFactory(serverHost: address, serverPort: post, protocolObfuscaterFactory: obfuscater, cryptorFactory: cryptor, streamObfuscaterFactory: stream)
// 直连适配器
let directAdapterFactory = DirectAdapterFactory()
// 设置用户规则
var userRules:[Rule] = []
// 直连规则
let directRules = cofigureAdapter(adapter: directAdapterFactory, parameters: rulesDic[directKey] as? [String : Any])
// 代理规则
let adapterRules = cofigureAdapter(adapter: ssAdapterFactory, parameters: rulesDic[proxyAdapterKey] as? [String : Any])
// 注意: 谁先放在前面,谁的优先级就比较高
userRules.append(contentsOf: adapterRules)
userRules.append(contentsOf: directRules)
// 其他规则
let unKnowLoc = CountryRule(countryCode: "--", match: true, adapterFactory: ssAdapterFactory)
let dnsFailRule = DNSFailRule(adapterFactory: ssAdapterFactory)
let allRule = AllRule(adapterFactory: ssAdapterFactory)
userRules.append(contentsOf: [unKnowLoc,dnsFailRule,allRule])
let manager = RuleManager(fromRules: userRules, appendDirect: true)
RuleManager.currentManager = manager`
from nekit.
from nekit.
from nekit.
大佬,能帮忙分析下原因吗。。
from nekit.
from nekit.
Related Issues (20)
- 使用NEKit能否完全使用tcp/udp的方式去代理呢? HOT 2
- 关于dns转发的疑问 HOT 15
- nekit vpn打开之后 微信,qq 这种基于socket做的通信类app都无法访问
- 请问支持V2ray vmess协议吗? HOT 3
- 我设置全局走代理,ios12正常,ios13偶尔不走代理
- 编译报错(Module 'NEKit' was created for incompatible target x86_64-apple-macos10.11:) HOT 2
- support SSR? HOT 1
- mayday mayday telegram连接的问题 HOT 2
- is there any plan to support AES256GCM?
- xcode11.2.1 telegram socks5代理连接失败 HOT 3
- Question HOT 2
- How to support aes-256-gcm? HOT 2
- xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH HOT 1
- 新手问一下怎么打包带CHACHA20POLY1305的项目 HOT 1
- 求助HTTPS代理怎么设置呢? HOT 29
- 你好,我试用NEkit 软件在后台经常遇到Crashed HOT 11
- 这个框架能链接V2ray吗
- Fails when `Building scheme "iOS Framework" in CocoaAsyncSocket.xcodeproj` HOT 5
- 连接几次后,打开网络或者请求VPN就会断开,请问什么原因 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nekit.