public DebugVpnContext() { #if !YT_MOCK tun = new TunInterface(); tun.PacketPoped += Tun_PacketPoped; #endif }
public HttpAdapter(string srv, int port, TcpSocket socket, TunInterface tun) : base(socket, tun) { server = srv; this.port = port; Init(); }
internal TunSocketAdapter(TcpSocket socket, TunInterface tun) { var pipe = new Pipe(); pipeReader = pipe.Reader; pipeWriter = pipe.Writer; _socket = socket; _tun = tun; socket.DataReceived += Socket_DataReceived; socket.DataSent += Socket_DataSent; socket.SocketError += Socket_SocketError; StartPolling(); }
public ProxyAdapter(TcpSocket socket, TunInterface tun) : base(socket, tun) { ReadData += ProxyAdapter_ReadData; OnError += ProxyAdapter_OnError; OnFinished += ProxyAdapter_OnFinished; }
public ShadowsocksAdapter(string srv, int port, ICryptor _cryptor, TcpSocket socket, TunInterface tun) : base(socket, tun) { server = srv; this.port = port; cryptor = _cryptor; Init(); }
public TrojanAdapter(string srv, int port, string hashedPassword, TcpSocket socket, TunInterface tun) : base(socket, tun) { if (!ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5)) { throw new InvalidOperationException("Trojan adapter is not supported on platforms earlier than 1709"); } server = srv; this.port = port; // TODO: hash password if (hashedPassword.Length != 56 || hashedPassword.Any(c => !((c >= 0 && c <= 9) || (c > 'a' && c < 'f')))) { throw new ArgumentOutOfRangeException("Hashed password only allows 56 hex characters"); } Init(hashedPassword); }
public DebugVpnContext(string port) { tun = new TunInterface(); tun.PacketPoped += Tun_PacketPoped; this.port = port; }