mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
missing files added
This commit is contained in:
@@ -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 {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user