missing files added
This commit is contained in:
parent
db527be97c
commit
7131257354
227 changed files with 16475 additions and 0 deletions
21
client/platforms/ios/tun2sockswriter.swift
Normal file
21
client/platforms/ios/tun2sockswriter.swift
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import Foundation
|
||||
import NetworkExtension
|
||||
import Tun2socks
|
||||
|
||||
class AmneziaTun2SocksWriter: NSObject, Tun2socksTunWriterProtocol {
|
||||
var tunnelFlow: NEPacketTunnelFlow
|
||||
|
||||
init( withPacketFlow nepflow: NEPacketTunnelFlow) {
|
||||
self.tunnelFlow = nepflow
|
||||
super.init()
|
||||
}
|
||||
|
||||
func write(_ p0: Data?, n: UnsafeMutablePointer<Int>?) throws {
|
||||
if let packets = p0 {
|
||||
tunnelFlow.writePackets([packets], withProtocols: [NSNumber(value: PF_INET)])
|
||||
}
|
||||
}
|
||||
|
||||
func close() throws {}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue