Move frameworks from extemsion to host app
This commit is contained in:
parent
8591d4e96c
commit
b20e25f052
14 changed files with 172 additions and 138 deletions
|
|
@ -3,19 +3,19 @@ import NetworkExtension
|
|||
import Tun2socks
|
||||
|
||||
class AmneziaTun2SocksWriter: NSObject, Tun2socksTunWriterProtocol {
|
||||
var tunnelFlow: NEPacketTunnelFlow
|
||||
var tunnelFlow: NEPacketTunnelFlow
|
||||
|
||||
init( withPacketFlow nepflow: NEPacketTunnelFlow) {
|
||||
self.tunnelFlow = nepflow
|
||||
super.init()
|
||||
}
|
||||
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 write(_ p0: Data?, n: UnsafeMutablePointer<Int>?) throws {
|
||||
if let packets = p0 {
|
||||
tunnelFlow.writePackets([packets], withProtocols: [NSNumber(value: PF_INET)])
|
||||
}
|
||||
}
|
||||
|
||||
func close() throws {}
|
||||
func close() throws {}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue