You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

PayloadProtocolClient.cs 620 B

123456789101112131415161718192021
  1. using Shadowsocks.Protocol.Socks5;
  2. using System.IO.Pipelines;
  3. using System.Net;
  4. using System.Threading.Tasks;
  5. namespace Shadowsocks.Protocol.Shadowsocks
  6. {
  7. // shadowsocks payload protocol client
  8. class PayloadProtocolClient : IStreamClient
  9. {
  10. public async Task Connect(EndPoint destination, IDuplexPipe client, IDuplexPipe server)
  11. {
  12. var addrMem = server.Output.GetMemory(512);
  13. var addrLen = Socks5Message.SerializeAddress(addrMem, destination);
  14. server.Output.Advance(addrLen);
  15. await DuplexPipe.CopyDuplexPipe(client, server);
  16. }
  17. }
  18. }